spec: add spec to flags spec

This commit is contained in:
Ayush Poddar 2023-04-19 16:32:11 +05:30
parent 0421206076
commit 7eda794a07
2 changed files with 8 additions and 0 deletions

View file

@ -140,6 +140,14 @@ RSpec.describe ColorLS::Flags do
end
end
context 'with --long and --non-human-readable flag for `2MB file`' do
let(:args) { ['--long', '--non-human-readable', "#{FIXTURES}/two_megabyte_file.txt"] }
it 'shows the file size in bytes' do
expect { subject }.to output(/#{2 * 1024 * 1024} B/).to_stdout
end
end
context 'with --long flag on windows' do
let(:args) { ['--long', "#{FIXTURES}/a.txt"] }

BIN
spec/fixtures/two_megabyte_file.txt vendored Normal file

Binary file not shown.