summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authormwrock <matt@mattwrock.com>2020-10-01 16:31:42 -0700
committermwrock <matt@mattwrock.com>2020-10-01 16:31:42 -0700
commitc811d58a84cc2b92a24b28b3557f03c4ce17b5bc (patch)
tree8297a747d40a65822eccc55c8df57fe3c3e31967 /spec/functional
parent6b077d998a0c3168cb7edb19d9d70d122ecafc95 (diff)
downloadchef-c811d58a84cc2b92a24b28b3557f03c4ce17b5bc.tar.gz
add interpreter arg to powershell_out allowing it to call pwsh.exe
Signed-off-by: mwrock <matt@mattwrock.com>
Diffstat (limited to 'spec/functional')
-rw-r--r--spec/functional/mixin/powershell_out_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/functional/mixin/powershell_out_spec.rb b/spec/functional/mixin/powershell_out_spec.rb
index 1ef9776efc..d9b5c69cd6 100644
--- a/spec/functional/mixin/powershell_out_spec.rb
+++ b/spec/functional/mixin/powershell_out_spec.rb
@@ -18,7 +18,7 @@
require "spec_helper"
require "chef/mixin/powershell_out"
-describe Chef::Mixin::PowershellOut, windows_only: true do
+describe Chef::Mixin::PowershellOut, :windows_only do
include Chef::Mixin::PowershellOut
describe "#powershell_out" do
@@ -26,6 +26,14 @@ describe Chef::Mixin::PowershellOut, windows_only: true do
expect(powershell_out("get-process").run_command.stdout).to match /Handles/
end
+ it "uses :powershell by default" do
+ expect(powershell_out("$PSVersionTable").run_command.stdout).to match /Desktop/
+ end
+
+ it ":pwsh interpreter uses core edition", :pwsh_installed do
+ expect(powershell_out("$PSVersionTable", :pwsh).run_command.stdout).to match /Core/
+ end
+
it "does not raise exceptions when the command is invalid" do
powershell_out("this-is-not-a-valid-command").run_command
end