diff options
author | John Keiser <john@johnkeiser.com> | 2015-09-29 09:12:23 -0700 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-09-29 09:12:23 -0700 |
commit | ca245c2710cc869b00df13deaf0acf82e97d6d78 (patch) | |
tree | 90b596beb9e42b870787465afdb3dac66483d51c /spec/unit/provider_resolver_spec.rb | |
parent | 8f65f75b2ae48ed33cfce1853edcdcc1a949b9c3 (diff) | |
download | chef-ca245c2710cc869b00df13deaf0acf82e97d6d78.tar.gz |
Fix provider_resolver tests on Windowsjk/win-provider-resolver-tests
Diffstat (limited to 'spec/unit/provider_resolver_spec.rb')
-rw-r--r-- | spec/unit/provider_resolver_spec.rb | 4 |
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 |