diff --git a/spec/color_ls/flags_spec.rb b/spec/color_ls/flags_spec.rb index d45efd29..6c03082b 100644 --- a/spec/color_ls/flags_spec.rb +++ b/spec/color_ls/flags_spec.rb @@ -20,9 +20,9 @@ end.not_to output(/((r|-).*(w|-).*(x|-).*){3}/).to_stdout } - it('does not display hidden files') { expect { subject }.not_to output(/\.hidden-file/).to_stdout } - it('does not show a report') { expect { subject }.not_to output(/Found \d+ contents/).to_stdout } - it('displays dirs & files alphabetically') { expect { subject }.to output(/a-file.+symlinks.+z-file/m).to_stdout } + it('does not display hidden files') { expect { subject }.not_to output(/\.hidden-file/).to_stdout } + it('does not show a report') { expect { subject }.not_to output(/(Found \d+ items in total\.)|(Folders: \d+, Files: \d+\.)/).to_stdout } + it('displays dirs & files alphabetically') { expect { subject }.to output(/a-file.+symlinks.+z-file/m).to_stdout } it 'displays multiple files per line' do allow($stdout).to receive(:tty?).and_return(true) @@ -352,11 +352,19 @@ end end - context 'with unrecognized files' do - let(:args) { ['--report', FIXTURES] } + context 'with --report flag' do + let(:args) { ['--report', '--report=long', FIXTURES] } - it 'shows a report with unrecognized files' do - expect { subject }.to output(/Unrecognized files\s+: 3/).to_stdout + it 'shows a report with recognized and unrecognized files' do + expect { subject }.to output(/Recognized files\s+: 3\n.+Unrecognized files\s+: 3/).to_stdout + end + end + + context 'with --report=short flag' do + let(:args) { ['--report=short', FIXTURES] } + + it 'shows a brief report' do + expect { subject }.to output(/Folders: \d+, Files: \d+\./).to_stdout end end diff --git a/test/checks b/test/checks index 66338905..0714f5a8 100644 --- a/test/checks +++ b/test/checks @@ -34,6 +34,9 @@ OK colorls --color=never OK colorls --color=always OK colorls --tree spec OK colorls --tree=1 +OK colorls --report +OK colorls --report=long +OK colorls --report=short LC_ALL=C OK colorls spec/fixtures/ LC_ALL=C OK colorls --git spec/fixtures/