Verify that a failing formatter fails the whole process

This commit is contained in:
Sven Weidauer 2022-06-06 11:32:59 +02:00
parent 8d8471951a
commit 159c0ac25b

View file

@ -119,4 +119,10 @@ describe FormatStaged do
expect(repo.get_content('test.test')).to eq('#clear')
expect(repo.get_content('other.test')).to eq('a = b')
end
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
end
end