1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/ruby/test_refinement.rb: prevent "assigned but unused variable"

This commit is contained in:
Yusuke Endoh 2021-05-14 15:44:13 +09:00
parent f691c15792
commit 702961a88b

View file

@ -2490,7 +2490,7 @@ class TestRefinement < Test::Unit::TestCase
def test_defining_after_cached def test_defining_after_cached
klass = Class.new klass = Class.new
refinement = Module.new { refine(klass) { def foo; end } } _refinement = Module.new { refine(klass) { def foo; end } }
klass.new.foo rescue nil # cache the refinement method entry klass.new.foo rescue nil # cache the refinement method entry
klass.define_method(:foo) { 42 } klass.define_method(:foo) { 42 }
assert_equal(42, klass.new.foo) assert_equal(42, klass.new.foo)