From 527a63d83cf333e8688c54993acbaf95cfebbedf Mon Sep 17 00:00:00 2001 From: Ho-Sheng Hsiao Date: Fri, 30 Mar 2012 21:10:06 -0400 Subject: [CHEF-2994][WINDOWS] Added specs for empty command --- spec/mixlib/shellout/windows_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spec/mixlib/shellout/windows_spec.rb') 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}\"" } -- cgit v1.2.1