Check that files stay unchanged in write mode.

This commit is contained in:
Sven Weidauer 2022-06-06 11:38:37 +02:00
parent 9a18902495
commit 7da4a0e0f0

View file

@ -125,4 +125,13 @@ describe FormatStaged do
repo.stage 'test.test'
expect { repo.run_formatter }.to raise_error
end
it 'leaves files alone when write is false' do
repo.set_content 'test.test', 'a=b'
repo.stage 'test.test'
expect(repo.run_formatter write: false).to be_truthy
expect(repo.get_content('test.test')).to eq 'a=b'
expect(repo.get_staged('test.test')).to eq 'a=b'
end
end