Skip to content

Commit

Permalink
Merge pull request #335 from puppetlabs/cat-1991-skip_missing_dir_check
Browse files Browse the repository at this point in the history
(maint) - Fix incorrect test for file_path
  • Loading branch information
jordanbreen28 authored Aug 21, 2024
2 parents 5603c13 + 463a1ba commit 351b383
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spec/unit/pwsh/util_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@
expect(described_class.invalid_directories?('')).to be false
end

it 'returns false if a file path is provided' do
expect(described_class.invalid_directories?(file_path)).to be false
it 'returns true if a file path is provided' do
expect(described_class).to receive(:on_windows?).and_return(true)
expect(File).to receive(:exist?).with(file_path).and_return(true)
expect(File).to receive(:directory?).with(file_path).and_return(false)
expect(described_class.invalid_directories?(file_path)).to be true
end

it 'returns false if one valid path is provided' do
Expand Down

0 comments on commit 351b383

Please sign in to comment.