Skip to content

Commit

Permalink
Merge pull request #358 from e2/e2-fix_broken_env_delete
Browse files Browse the repository at this point in the history
Fix broken ENV.delete on Windows
  • Loading branch information
Dennis Günnewig committed Mar 31, 2016
2 parents fca339b + f6f4951 commit 65d637d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/aruba/platforms/windows_environment_variables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def prepend(name, value)
super(name.upcase, value)
end

def delete(name, value)
super(name.upcase, value)
def delete(name)
super(name.upcase)
end
end
end
Expand Down
14 changes: 14 additions & 0 deletions spec/aruba/platform/windows_environment_variables_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -497,4 +497,18 @@ class KeyError < StandardError; end
end
end
end

describe '#delete' do
let(:variable) { 'my_variable' }
let(:old_environment) { { 'MY_VARIABLE' => '1' } }

it "deletes a value from the environment" do
environment.delete(variable)
expect(environment[variable]).to eq nil
end

it "returns deleted value" do
expect(environment.delete(variable)).to eq('1')
end
end
end

0 comments on commit 65d637d

Please sign in to comment.