Verify error messages
This commit is contained in:
parent
95633bfd9f
commit
3c7bfbc437
2 changed files with 6 additions and 2 deletions
|
@ -15,7 +15,9 @@ describe 'Test Hook' do
|
|||
end
|
||||
|
||||
it 'fails with a #fail line' do
|
||||
expect { run '#fail' }.to raise_error
|
||||
expect { run '#fail' }.to raise_error(RuntimeError) { |error|
|
||||
expect(error.message).to eq('Cannot run test_hook.rb')
|
||||
}
|
||||
end
|
||||
|
||||
def run(input)
|
||||
|
|
|
@ -123,7 +123,9 @@ describe FormatStaged do
|
|||
it 'fails if the hook returns a nonzero status' do
|
||||
repo.set_content 'test.test', '#fail'
|
||||
repo.stage 'test.test'
|
||||
expect { repo.run_formatter }.to raise_error
|
||||
expect { repo.run_formatter }.to raise_error(RuntimeError) { |error|
|
||||
expect(error.message).to eq 'Error formatting test.test'
|
||||
}
|
||||
end
|
||||
|
||||
it 'leaves files alone when write is false' do
|
||||
|
|
Loading…
Add table
Reference in a new issue