diff options
author | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2018-06-25 21:32:00 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-06-25 21:32:00 +0000 |
commit | dcdcbfa40b7732b12650d8046a84bed346843c90 (patch) | |
tree | d8193404d133c7554e84ecf0196d3cc9bdb8f7ae /spec/bin | |
parent | 2ee1913f1ab411bf873c9085621cacfaf7502575 (diff) | |
download | gitlab-ce-dcdcbfa40b7732b12650d8046a84bed346843c90.tar.gz |
Improve shelling out in bin/changelog
Diffstat (limited to 'spec/bin')
-rw-r--r-- | spec/bin/changelog_spec.rb | 11 |
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 |