test cases

This commit is contained in:
Ayush Poddar 2024-08-01 02:14:15 +05:30
parent 597a8c6807
commit 07d456005d
3 changed files with 8 additions and 0 deletions

View file

@ -103,6 +103,14 @@ RSpec.describe ColorLS::Flags do
let(:args) { ['--long', FIXTURES] }
it('lists file info') { expect { subject }.to output(/((r|-).*(w|-).*(x|-).*){3}/).to_stdout }
it 'rounds up file size to nearest MiB' do
expect { subject }.to output(/2 MiB[^\n]* 20kb-less-than-2mb\.txt/).to_stdout
end
it 'rounds down file size to nearest MiB' do
expect { subject }.to output(/1 MiB[^\n]* 20kb-more-than-1mb\.txt/).to_stdout
end
end
context 'with --long flag for `a.txt`' do

BIN
spec/fixtures/20kb-less-than-2mb.txt vendored Normal file

Binary file not shown.

BIN
spec/fixtures/20kb-more-than-1mb.txt vendored Normal file

Binary file not shown.