diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_refinement.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 0d934d737e..016aa15f19 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -624,6 +624,33 @@ class TestRefinement < Test::Unit::TestCase end end + def test_using_in_module + assert_raise(RuntimeError) do + eval(<<-EOF, TOPLEVEL_BINDING) + $main = self + module M + end + module M2 + $main.send(:using, M) + end + EOF + end + end + + def test_using_in_method + assert_raise(RuntimeError) do + eval(<<-EOF, TOPLEVEL_BINDING) + $main = self + module M + end + def call_using_in_method + $main.send(:using, M) + end + call_using_in_method + EOF + end + end + private def eval_using(mod, s) |