summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2015-09-29 11:20:24 -0700
committerThom May <thom@may.lt>2015-09-29 11:20:24 -0700
commit3bff7d3e1343138a9d7796421b995bbcb4e9b317 (patch)
tree350625c84fb622d360ea79a199325b0897f98b71
parent65d2de8df1d40422b0f85fff17f34f474d4350c3 (diff)
parentca245c2710cc869b00df13deaf0acf82e97d6d78 (diff)
downloadchef-3bff7d3e1343138a9d7796421b995bbcb4e9b317.tar.gz
Merge pull request #3993 from chef/jk/win-provider-resolver-tests
Fix provider_resolver tests on Windows
-rw-r--r--spec/unit/provider_resolver_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb
index a2fa4d7829..2fb99f610c 100644
--- a/spec/unit/provider_resolver_spec.rb
+++ b/spec/unit/provider_resolver_spec.rb
@@ -161,6 +161,8 @@ describe Chef::ProviderResolver do
file 'bin/systemctl', ''
# Make systemctl executable
File.chmod(0755, path_to('bin/systemctl'))
+ # Windows doesn't respect executable bit, do this to let Windows users see if they've broken the resolver
+ allow(::File).to receive(:executable?) { |p| p == path_to('bin/systemctl') } if windows?
file 'proc/1/comm', "systemd\n"
mock_shellout_command("/bin/systemctl --all", stdout: "")
mock_shellout_command("/bin/systemctl list-unit-files", stdout: "")
@@ -187,6 +189,8 @@ describe Chef::ProviderResolver do
file 'bin/systemctl', ''
# Make systemctl executable
File.chmod(0755, path_to("bin/systemctl"))
+ # Windows doesn't respect executable bit, do this to let Windows users see if they've broken the resolver
+ allow(::File).to receive(:executable?) { |p| p == path_to('bin/systemctl') } if windows?
file 'proc/1/comm', "systemd\n"
mock_shellout_command("/bin/systemctl --all", stdout: <<-EOM)
superv loaded