Skip to content

Commit

Permalink
CI: Fixed #set_environment_variable on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrasimplicity authored and mvz committed Jun 18, 2021
1 parent 42f9631 commit 0f56991
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/aruba/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,23 @@
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

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
Expand Down

0 comments on commit 0f56991

Please sign in to comment.