mirror of
https://github.com/athityakumar/colorls.git
synced 2024-09-19 05:31:23 +02:00
Add specs for --all & --report flags
This commit is contained in:
parent
3b783382f5
commit
a79673078a
1 changed files with 19 additions and 1 deletions
|
@ -1,11 +1,29 @@
|
|||
require 'spec_helper'
|
||||
|
||||
RSpec.describe ColorLS do
|
||||
FIXTURES = 'spec/fixtures'.freeze
|
||||
|
||||
it 'has a version number' do
|
||||
expect(ColorLS::VERSION).not_to be nil
|
||||
end
|
||||
|
||||
it 'lists info of a hidden file with --long option' do
|
||||
expect { ColorLS::Flags.new('--long', 'spec/fixtures/.hidden-file').process }.to_not output(/No Info/).to_stdout
|
||||
expect { ColorLS::Flags.new('--long', "#{FIXTURES}/.hidden-file").process }.to_not output(/No Info/).to_stdout
|
||||
end
|
||||
|
||||
it 'does not list hidden files without --all option' do
|
||||
expect { ColorLS::Flags.new(FIXTURES).process }.to_not output(/\.hidden-file/).to_stdout
|
||||
end
|
||||
|
||||
it 'lists hidden files with --all option' do
|
||||
expect { ColorLS::Flags.new('--all', FIXTURES).process }.to output(/\.hidden-file/).to_stdout
|
||||
end
|
||||
|
||||
it 'does not show a report without --report option' do
|
||||
expect { ColorLS::Flags.new(FIXTURES).process }.to_not output(/Found \d+ contents/).to_stdout
|
||||
end
|
||||
|
||||
it 'shows a report with --report option' do
|
||||
expect { ColorLS::Flags.new('--report', FIXTURES).process }.to output(/Found \d+ contents/).to_stdout
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue