Skip to content

Commit

Permalink
Fix symlink/ test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
avdv committed Apr 29, 2022
1 parent 3fd70d1 commit dae7a54
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions spec/color_ls/flags_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,19 +321,20 @@
it { expect { subject }.to output(/Supportlink/).to_stdout }
end

# context 'symlinked directory with trailing separator' do
# let(:args) { ['-x', File.join(FIXTURES, 'symlinks', 'Supportlink', File::SEPARATOR)] }

# it 'shows the file in the linked directory' do
# stat = File.lstat File.join(FIXTURES, 'symlinks', 'Supportlink')

# if stat.symlink?
# expect { subject }.to output(/yaml_sort_checker.rb/).to_stdout
# else
# skip 'symlinks not supported'
# end
# end
# end
context 'symlinked directory with trailing separator' do
link_to_dir = File.join(FIXTURES, 'symlinks', 'Supportlink', File::SEPARATOR)
let(:args) { ['-x', link_to_dir] }

it 'shows the file in the linked directory' do
stat = File.lstat link_to_dir

if stat.directory?
expect { subject }.to output(/yaml_sort_checker.rb/).to_stdout
else
skip 'symlinks not supported'
end
end
end

context 'when passing invalid flags' do
let(:args) { ['--snafu'] }
Expand Down

0 comments on commit dae7a54

Please # to comment.