summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMatt Wrock <matt@mattwrock.com>2015-09-11 15:04:02 -0700
committerMatt Wrock <matt@mattwrock.com>2015-09-11 15:04:02 -0700
commit8446b81929d3a1c3ef2dd24d5d93802add1791dc (patch)
tree28038822e052d37a479da8cf5f58f182b2ae12cd /spec
parentaad254180a12abc1847a1f0c52a43d947e301031 (diff)
downloadmixlib-shellout-8446b81929d3a1c3ef2dd24d5d93802add1791dc.tar.gz
prevent shellout from attempting to execute a directory on windows
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout/windows_spec.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/mixlib/shellout/windows_spec.rb b/spec/mixlib/shellout/windows_spec.rb
index 118be75..dd8a80b 100644
--- a/spec/mixlib/shellout/windows_spec.rb
+++ b/spec/mixlib/shellout/windows_spec.rb
@@ -170,6 +170,7 @@ describe 'Mixlib::ShellOut::Windows', :windows_only do
allow(ENV).to receive(:[]).with('COMSPEC').and_return('C:\Windows\system32\cmd.exe')
allow(File).to receive(:executable?).and_return(false)
allow(File).to receive(:executable?).with(executable_path).and_return(true)
+ allow(File).to receive(:directory?).and_return(false)
end
it 'should return with full path with extension' do
@@ -180,6 +181,7 @@ describe 'Mixlib::ShellOut::Windows', :windows_only do
before do
# File.executable? returns true for directories
allow(File).to receive(:executable?).with(cmd).and_return(true)
+ allow(File).to receive(:directory?).with(cmd).and_return(true)
end
it 'should return with full path with extension' do