From db595dca23b18e3da882b105b22679a0d2e1433c Mon Sep 17 00:00:00 2001 From: "Marc A. Paradise" Date: Thu, 6 Oct 2022 16:35:30 -0400 Subject: Allow dsc_refresh_mode_disabled to be invoked in test Currently we're failing this test on a pre-emptive direct execution of Get-LocalDscConfigurationManager that we're doing in the test. It is not returning the expected result, but it's hiding the errors. Instead, we'll let the actual thing we want to test occur (dsc_refresh_mode_disabled) - because it runs the same command, and raises an error if it fails. Signed-off-by: Marc A. Paradise --- spec/unit/platform/query_helpers_spec.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'spec') diff --git a/spec/unit/platform/query_helpers_spec.rb b/spec/unit/platform/query_helpers_spec.rb index 424bd6348b..0671d98476 100644 --- a/spec/unit/platform/query_helpers_spec.rb +++ b/spec/unit/platform/query_helpers_spec.rb @@ -41,12 +41,8 @@ end describe "Chef::Platform#dsc_refresh_mode_disabled?", :windows_only do let(:node) { instance_double("Chef::Node") } - let(:powershell) { Class.new { include ChefPowerShell::ChefPowerShellModule::PowerShellExec } } - subject(:object) { powershell.new } it "returns true when RefreshMode is Disabled" do - execution = object.powershell_exec("Get-DscLocalConfigurationManager", :powershell, timeout: -1) - expect(execution.result["RefreshMode"]).to eq "PUSH" expect(Chef::Platform.dsc_refresh_mode_disabled?(node)).to be false end end -- cgit v1.2.1