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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
813fd6f6
Commit
813fd6f6
authored
Nov 02, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DRY up the specs for bin/changelog
parent
651bdd7c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
36 deletions
+20
-36
spec/bin/changelog_spec.rb
spec/bin/changelog_spec.rb
+20
-36
No files found.
spec/bin/changelog_spec.rb
View file @
813fd6f6
...
...
@@ -10,54 +10,38 @@ describe 'bin/changelog' do
expect
(
options
.
amend
).
to
eq
true
end
it
'parses --force'
do
options
=
described_class
.
parse
(
%w[foo --force bar]
)
it
'parses --force and -f'
do
%w[--force -f]
.
each
do
|
flag
|
options
=
described_class
.
parse
(
%W[foo
#{
flag
}
bar]
)
expect
(
options
.
force
).
to
eq
true
end
it
'parses -f'
do
options
=
described_class
.
parse
(
%w[foo -f bar]
)
expect
(
options
.
force
).
to
eq
true
end
it
'parses --merge-request'
do
options
=
described_class
.
parse
(
%w[foo --merge-request 1234 bar]
)
it
'parses --merge-request and -m'
do
%w[--merge-request -m]
.
each
do
|
flag
|
options
=
described_class
.
parse
(
%W[foo
#{
flag
}
1234 bar]
)
expect
(
options
.
merge_request
).
to
eq
1234
end
it
'parses -m'
do
options
=
described_class
.
parse
(
%w[foo -m 4321 bar]
)
expect
(
options
.
merge_request
).
to
eq
4321
end
it
'parses --dry-run'
do
options
=
described_class
.
parse
(
%w[foo --dry-run bar]
)
it
'parses --dry-run and -n'
do
%w[--dry-run -n]
.
each
do
|
flag
|
options
=
described_class
.
parse
(
%W[foo
#{
flag
}
bar]
)
expect
(
options
.
dry_run
).
to
eq
true
end
it
'parses -n'
do
options
=
described_class
.
parse
(
%w[foo -n bar]
)
expect
(
options
.
dry_run
).
to
eq
true
end
it
'parses --git-username'
do
it
'parses --git-username
and -u
'
do
allow
(
described_class
).
to
receive
(
:git_user_name
).
and_return
(
'Jane Doe'
)
options
=
described_class
.
parse
(
%w[foo --git-username bar]
)
%w[--git-username -u]
.
each
do
|
flag
|
options
=
described_class
.
parse
(
%W[foo
#{
flag
}
bar]
)
expect
(
options
.
author
).
to
eq
'Jane Doe'
end
it
'parses -u'
do
allow
(
described_class
).
to
receive
(
:git_user_name
).
and_return
(
'John Smith'
)
options
=
described_class
.
parse
(
%w[foo -u bar]
)
expect
(
options
.
author
).
to
eq
'John Smith'
end
it
'parses -h'
do
...
...
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