summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHo-Sheng Hsiao <hosheng.hsiao@gmail.com>2012-03-30 21:12:52 -0400
committerHo-Sheng Hsiao <hosh@opscode.com>2012-05-10 14:48:30 -0400
commitcf71f71368646904f39ef6012424b41488a38c58 (patch)
tree0800263a0a68aa4fff8217ea98860699773a49a8 /spec
parent527a63d83cf333e8688c54993acbaf95cfebbedf (diff)
downloadmixlib-shellout-cf71f71368646904f39ef6012424b41488a38c58.tar.gz
[CHEF-2994][WINDOWS] Added specs for valid exe at location with unquoted exe
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout/windows_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/mixlib/shellout/windows_spec.rb b/spec/mixlib/shellout/windows_spec.rb
index dc25b54..552e7f5 100644
--- a/spec/mixlib/shellout/windows_spec.rb
+++ b/spec/mixlib/shellout/windows_spec.rb
@@ -117,6 +117,31 @@ describe Mixlib::ShellOut::Windows, :windows_only => true do
context 'with valid executable at location' do
let(:stubbed_shell_out) { shell_out.tap(&with_valid_exe_at_location) }
+ context 'with executable path' do
+ let(:cmd) { "#{executable_path}" }
+ let(:executable_path) { 'C:\RUBY192\bin\ruby.exe' }
+
+ it 'should use specified executable' do
+ should eql([executable_path, cmd])
+ end
+
+ context 'with arguments' do
+ let(:cmd) { "#{executable_path} arguments" }
+
+ it 'should use specified executable' do
+ should eql([executable_path, cmd])
+ end
+ end
+
+ context 'with quoted arguments' do
+ let(:cmd) { "#{executable_path} -e \"print 'fee fie foe fum'\"" }
+
+ it 'should use specified executable' do
+ should eql([executable_path, cmd])
+ end
+ end
+ end
+
# Examples taken from: https://github.com/opscode/mixlib-shellout/pull/2#issuecomment-4825574
context 'with executable path enclosed in double quotes' do
let(:cmd) { "#{executable_path}" }