summaryrefslogtreecommitdiff
path: root/spec/bin/changelog_spec.rb
diff options
context:
space:
mode:
authorJacob Vosmaer (GitLab) <jacob@gitlab.com>2018-06-25 21:32:00 +0000
committerRobert Speicher <robert@gitlab.com>2018-06-25 21:32:00 +0000
commitdcdcbfa40b7732b12650d8046a84bed346843c90 (patch)
treed8193404d133c7554e84ecf0196d3cc9bdb8f7ae /spec/bin/changelog_spec.rb
parent2ee1913f1ab411bf873c9085621cacfaf7502575 (diff)
downloadgitlab-ce-dcdcbfa40b7732b12650d8046a84bed346843c90.tar.gz
Improve shelling out in bin/changelog
Diffstat (limited to 'spec/bin/changelog_spec.rb')
-rw-r--r--spec/bin/changelog_spec.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/bin/changelog_spec.rb b/spec/bin/changelog_spec.rb
index fc1bf67d7b9..f278043028f 100644
--- a/spec/bin/changelog_spec.rb
+++ b/spec/bin/changelog_spec.rb
@@ -56,11 +56,11 @@ describe 'bin/changelog' do
it 'parses -h' do
expect do
expect { described_class.parse(%w[foo -h bar]) }.to output.to_stdout
- end.to raise_error(SystemExit)
+ end.to raise_error(ChangelogHelpers::Done)
end
it 'assigns title' do
- options = described_class.parse(%W[foo -m 1 bar\n -u baz\r\n --amend])
+ options = described_class.parse(%W[foo -m 1 bar\n baz\r\n --amend])
expect(options.title).to eq 'foo bar baz'
end
@@ -82,9 +82,10 @@ describe 'bin/changelog' do
it 'shows error message and exits the program' do
allow($stdin).to receive(:getc).and_return(type)
expect do
- expect do
- expect { described_class.read_type }.to raise_error(SystemExit)
- end.to output("Invalid category index, please select an index between 1 and 8\n").to_stderr
+ expect { described_class.read_type }.to raise_error(
+ ChangelogHelpers::Abort,
+ 'Invalid category index, please select an index between 1 and 8'
+ )
end.to output.to_stdout
end
end