diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-17 00:17:15 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-17 12:30:38 +0900 |
commit | 11a9f7ab9431b0f361e43b4ac2bd6ee44827d88b (patch) | |
tree | f2ebdeb3b5430a65b4d0ee1e76afef7e729e3109 /test/ruby | |
parent | 042be439d92ea0910fe3bd0d5e9a1d4135257d2d (diff) | |
download | ruby-11a9f7ab9431b0f361e43b4ac2bd6ee44827d88b.tar.gz |
Search refinement module along nested usings
[Bug #16107]
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_refinement.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index afb4784d00..87d60e41a4 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -2295,6 +2295,34 @@ class TestRefinement < Test::Unit::TestCase d end + class RefineInUsing + module M1 + refine RefineInUsing do + def foo + :ok + end + end + end + + module M2 + using M1 + refine RefineInUsing do + def call_foo + RefineInUsing.new.foo + end + end + end + + using M2 + def self.test + new.call_foo + end + end + + def test_refine_in_using + assert_equal(:ok, RefineInUsing.test) + end + private def eval_using(mod, s) |