mirror of
https://github.com/athityakumar/colorls.git
synced 2024-09-19 05:31:23 +02:00
Merge pull request #392 from avdv/fix-unrecognized
Fix unrecognized files count and colorization
This commit is contained in:
commit
965eb6130d
2 changed files with 9 additions and 1 deletions
|
@ -328,9 +328,9 @@ module ColorLS
|
|||
else
|
||||
key = content.name.split('.').last.downcase.to_sym
|
||||
key = @file_aliases[key] unless @files.key? key
|
||||
key = :file if key.nil?
|
||||
color = file_color(content, key)
|
||||
group = @files.key?(key) ? :recognized_files : :unrecognized_files
|
||||
key = :file if key.nil?
|
||||
end
|
||||
|
||||
[key, color, group]
|
||||
|
|
|
@ -300,4 +300,12 @@ RSpec.describe ColorLS::Flags do
|
|||
expect { subject }.to output(/setlocale error/).to_stderr.and output.to_stdout
|
||||
end
|
||||
end
|
||||
|
||||
context 'with unrecognized files' do
|
||||
let(:args) { ['--report', FIXTURES] }
|
||||
|
||||
it 'should show a report with unrecognized files' do
|
||||
expect { subject }.to output(/Unrecognized files\s+: 3/).to_stdout
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue