add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
60055f8dfd
commit
13a31356d8
@ -1494,6 +1494,35 @@ class TestRefinement < Test::Unit::TestCase
|
|||||||
INPUT
|
INPUT
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_reopen_refinement_module
|
||||||
|
assert_separately([], <<-"end;")
|
||||||
|
$VERBOSE = nil
|
||||||
|
class C
|
||||||
|
end
|
||||||
|
|
||||||
|
module R
|
||||||
|
refine C do
|
||||||
|
def m
|
||||||
|
:foo
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
using R
|
||||||
|
assert_equal(:foo, C.new.m)
|
||||||
|
|
||||||
|
module R
|
||||||
|
refine C do
|
||||||
|
def m
|
||||||
|
:bar
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_equal(:bar, C.new.m)
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def eval_using(mod, s)
|
def eval_using(mod, s)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user