From ca245c2710cc869b00df13deaf0acf82e97d6d78 Mon Sep 17 00:00:00 2001 From: John Keiser Date: Tue, 29 Sep 2015 09:12:23 -0700 Subject: Fix provider_resolver tests on Windows --- spec/unit/provider_resolver_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spec') 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 -- cgit v1.2.1