diff --git a/lib/chef/knife/solo_cook.rb b/lib/chef/knife/solo_cook.rb index 57be8051..c90f5f29 100644 --- a/lib/chef/knife/solo_cook.rb +++ b/lib/chef/knife/solo_cook.rb @@ -112,8 +112,11 @@ def validate! end def provisioning_path - # TODO ~ will likely break on cmd.exe based windows sessions - config_value(:provisioning_path, '~/chef-solo') + if windows_node? + config_value(:provisioning_path, 'chef-solo') + else + config_value(:provisioning_path, '~/chef-solo') + end end def sync_kitchen diff --git a/test/solo_cook_test.rb b/test/solo_cook_test.rb index 067ebdb1..3ccdb163 100644 --- a/test/solo_cook_test.rb +++ b/test/solo_cook_test.rb @@ -347,6 +347,15 @@ def test_passes_override_runlist_to_chef_solo assert_chef_solo_option "--override-runlist=sandbox::default", "-o sandbox::default" end + def test_removes_tilde_on_windows_node + in_kitchen do + cmd = command("somehost") + cmd.unstub(:windows_node?) + cmd.stubs(:windows_node? => true) + assert_equal 'chef-solo', cmd.provisioning_path + end + end + # Asserts that the chef_solo_option is passed to chef-solo iff cook_option # is specified for the cook command def assert_chef_solo_option(cook_option, chef_solo_option) @@ -368,6 +377,7 @@ def command(*args) cmd.stubs(:run_portable_mkdir_p) cmd.stubs(:rsync) cmd.stubs(:stream_command).returns(SuccessfulResult.new) + cmd.stubs(:windows_node? => false) cmd end end