Skip to content

Commit 351b383

Browse files
Merge pull request #335 from puppetlabs/cat-1991-skip_missing_dir_check
(maint) - Fix incorrect test for file_path
2 parents 5603c13 + 463a1ba commit 351b383

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec/unit/pwsh/util_spec.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@
105105
expect(described_class.invalid_directories?('')).to be false
106106
end
107107

108-
it 'returns false if a file path is provided' do
109-
expect(described_class.invalid_directories?(file_path)).to be false
108+
it 'returns true if a file path is provided' do
109+
expect(described_class).to receive(:on_windows?).and_return(true)
110+
expect(File).to receive(:exist?).with(file_path).and_return(true)
111+
expect(File).to receive(:directory?).with(file_path).and_return(false)
112+
expect(described_class.invalid_directories?(file_path)).to be true
110113
end
111114

112115
it 'returns false if one valid path is provided' do

0 commit comments

Comments
 (0)