summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHo-Sheng Hsiao <hosheng.hsiao@gmail.com>2012-03-30 21:10:06 -0400
committerHo-Sheng Hsiao <hosh@opscode.com>2012-05-10 14:48:30 -0400
commit527a63d83cf333e8688c54993acbaf95cfebbedf (patch)
tree45700abdc923b6c9d206794899c9d1a54ed7fd07 /spec
parentfbb9a538f82209084a1a4b029edf48ad0e66a43b (diff)
downloadmixlib-shellout-527a63d83cf333e8688c54993acbaf95cfebbedf.tar.gz
[CHEF-2994][WINDOWS] Added specs for empty command
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout/windows_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/mixlib/shellout/windows_spec.rb b/spec/mixlib/shellout/windows_spec.rb
index 66aca8d..dc25b54 100644
--- a/spec/mixlib/shellout/windows_spec.rb
+++ b/spec/mixlib/shellout/windows_spec.rb
@@ -41,6 +41,15 @@ describe Mixlib::ShellOut::Windows, :windows_only => true do
let(:with_valid_exe_at_location) { lambda { |s| s.stub!(:find_exe_at_location).and_return(executable_path) } }
let(:with_invalid_exe_at_location) { lambda { |s| s.stub!(:find_exe_at_location).and_return(nil) } }
+ context 'with empty command' do
+ let(:stubbed_shell_out) { shell_out }
+ let(:cmd) { ' ' }
+
+ it 'should return with a nil executable' do
+ should eql([nil, cmd])
+ end
+ end
+
context 'with batch files' do
let(:stubbed_shell_out) { shell_out.tap(&with_valid_exe_at_location) }
let(:cmd_invocation) { "cmd /c \"#{cmd}\"" }