Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d4ae3e4d
Commit
d4ae3e4d
authored
Jun 13, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a JiraIssue class
parent
2b9a9d4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
app/models/jira_issue.rb
app/models/jira_issue.rb
+21
-0
spec/models/jira_issue_spec.rb
spec/models/jira_issue_spec.rb
+18
-0
No files found.
app/models/jira_issue.rb
0 → 100644
View file @
d4ae3e4d
class
JiraIssue
def
initialize
(
issue_identifier
)
@issue_identifier
=
issue_identifier
end
def
to_s
@issue_identifier
.
to_s
end
def
id
@issue_identifier
.
to_s
end
def
iid
@issue_identifier
.
to_s
end
def
==
(
other
)
other
.
is_a?
(
self
.
class
)
&&
(
to_s
==
other
.
to_s
)
end
end
spec/models/jira_issue_spec.rb
0 → 100644
View file @
d4ae3e4d
require
'spec_helper'
describe
JiraIssue
do
subject
{
JiraIssue
.
new
(
'JIRA-123'
)
}
its
(
:id
)
{
should
eq
(
'JIRA-123'
)
}
its
(
:iid
)
{
should
eq
(
'JIRA-123'
)
}
its
(
:to_s
)
{
should
eq
(
'JIRA-123'
)
}
describe
:==
do
specify
{
subject
.
should
eq
(
JiraIssue
.
new
(
'JIRA-123'
))
}
specify
{
subject
.
should_not
eq
(
JiraIssue
.
new
(
'JIRA-124'
))
}
it
'only compares with JiraIssues'
do
subject
.
should_not
eq
(
'JIRA-123'
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment