diff options
author | Pete Higgins <pete@peterhiggins.org> | 2020-08-07 17:57:13 -0700 |
---|---|---|
committer | Pete Higgins <pete@peterhiggins.org> | 2020-08-07 17:57:13 -0700 |
commit | 0faa0791c38e7ba4c082a88e1d6a436dc2a2f8b7 (patch) | |
tree | 475b8087a7bace2a49c3dcc3a9b152ef18c17e9e /spec/unit/provider | |
parent | c556b1da3dbc8b069dea54d9db239a73076d79d2 (diff) | |
download | chef-0faa0791c38e7ba4c082a88e1d6a436dc2a2f8b7.tar.gz |
Fix broken powershell_script test.fix-powershell-test
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
Diffstat (limited to 'spec/unit/provider')
-rw-r--r-- | spec/unit/provider/powershell_script_spec.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/unit/provider/powershell_script_spec.rb b/spec/unit/provider/powershell_script_spec.rb index a0f31c10f7..1c49c52160 100644 --- a/spec/unit/provider/powershell_script_spec.rb +++ b/spec/unit/provider/powershell_script_spec.rb @@ -32,15 +32,16 @@ describe Chef::Provider::PowershellScript, "action_run" do describe "#command" do before(:each) do - allow(provider).to receive(:basepath).and_return("C:/Windows/system32") + allow(provider).to receive(:basepath).and_return("C:\\Windows\\system32") + allow(ChefUtils).to receive(:windows?).and_return(true) end it "includes the user's flags after the default flags when building the command" do new_resource.flags = "-InputFormat Fabulous" - provider.send(:script_file_path=, "C:/Temp/Script.ps1") + provider.send(:script_file_path=, "C:\\Temp\\Script.ps1") expected = <<~CMD.strip - "C:/Windows/system32/WindowsPowerShell/v1.0/powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -InputFormat Fabulous -File "C:/Temp/Script.ps1" + "C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -InputFormat Fabulous -File "C:\\Temp\\Script.ps1" CMD expect(provider.command).to eq(expected) |