From c6b8cd790b1b520e3529017262c6199220da354e Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Fri, 3 Aug 2018 20:40:00 +1000 Subject: [PATCH] CI: Fixed `#set_environment_variable` on Windows --- spec/aruba/api_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/aruba/api_spec.rb b/spec/aruba/api_spec.rb index 2455fe44a..fe3db1dfa 100644 --- a/spec/aruba/api_spec.rb +++ b/spec/aruba/api_spec.rb @@ -40,13 +40,15 @@ end describe "#set_environment_variable" do + let(:get_env_cmd) { FFI::Platform.windows? ? "set" : "env" } + after do @aruba.all_commands.each(&:stop) end it "set environment variable" do @aruba.set_environment_variable "LONG_LONG_ENV_VARIABLE", "true" - @aruba.run_command_and_stop "env" + @aruba.run_command_and_stop get_env_cmd expect(@aruba.last_command_started.output) .to include("LONG_LONG_ENV_VARIABLE=true") end @@ -54,7 +56,7 @@ it "overwrites environment variable" do @aruba.set_environment_variable "LONG_LONG_ENV_VARIABLE", "true" @aruba.set_environment_variable "LONG_LONG_ENV_VARIABLE", "false" - @aruba.run_command_and_stop "env" + @aruba.run_command_and_stop get_env_cmd expect(@aruba.last_command_started.output) .to include("LONG_LONG_ENV_VARIABLE=false") end