From 55ef8f6f6ffe1a9772d970f34d96bdfd0782b7e0 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 e7da9ae15..e19d92a85 100644 --- a/spec/aruba/api_spec.rb +++ b/spec/aruba/api_spec.rb @@ -51,13 +51,15 @@ def root_directory end describe '#set_environment_variable' do + let(:get_env_cmd) { FFI::Platform.windows? ? 'set' : 'env' } + after(:each) 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 @@ -65,7 +67,7 @@ def root_directory 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