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