Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoid variable shadowing

  • Loading branch information...
commit c6e20b930a327eb928453c175d3b180d1393823c 1 parent 78fe3e8
Stephen Touset authored
Showing with 5 additions and 1 deletion.
  1. +4 −0 test/sodium/delegate_test.rb
  2. +1 −1  test/test_helper.rb
4 test/sodium/delegate_test.rb
View
@@ -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
2  test/test_helper.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.