Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
Avoid variable shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
stouset committed Mar 18, 2013
1 parent 78fe3e8 commit c6e20b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions test/sodium/delegate_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class Subclass2 < self; PRIMITIVE = :subclass2; end
self.klass.implementation.must_equal self.subclass
end

it 'must allow access to constants through indexing' do
self.klass.implementation[:PRIMITIVE].must_equal :subclass1
end

it 'must allow access to arbitrary implementations' do
self.klass.implementation(:subclass2).must_equal DelegateTest::Subclass2
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def sodium_override_default(klass, implementation)

def sodium_mock_default(klass)
mock = MiniTest::Mock.new
sodium_override_default(klass, mock) {|klass| yield klass, mock }
sodium_override_default(klass, mock) {|dup| yield dup, mock }
mock.verify
end

Expand Down

0 comments on commit c6e20b9

Please sign in to comment.