Skip to content

Commit

Permalink
Correctly update environment variables when set more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
njonsson committed Feb 22, 2013
1 parent 5fba2db commit 08daac3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cape/hash_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def []=(key, value)
Array(pair).first == key
end
if index
super key, value
super(index, [key, value])
else
self << [key, value]
end
Expand Down
2 changes: 2 additions & 0 deletions spec/cape/hash_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

describe 'when values are added out of order' do
before :each do
subject['foo'] = 'xxx'
subject['foo'] = 'bar'
subject['baz'] = 'qux'
end
Expand All @@ -35,6 +36,7 @@
it 'should index the values as expected' do
subject['foo'].should == 'bar'
subject['baz'].should == 'qux'
subject['not-found'].should be_nil
end

describe 'when sent #clear' do
Expand Down

0 comments on commit 08daac3

Please sign in to comment.