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 May 30, 2019
1 parent 0d47681 commit 55ef8f6
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 @@ -51,21 +51,23 @@ 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

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 55ef8f6

Please sign in to comment.