diff options
-rw-r--r-- | test/ruby/test_module.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 72dc34ee0c..3ecdf7ad7c 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1069,7 +1069,7 @@ class TestModule < Test::Unit::TestCase assert_in_out_err([], src, ["NameError"], []) end - def test_mix + def test_mix_method american = Module.new do attr_accessor :address end @@ -1112,4 +1112,19 @@ class TestModule < Test::Unit::TestCase } } end + + def test_mix_const + foo = Module.new do + const_set(:D, 55) + end + bar = Class.new do + const_set(:D, 42) + end + assert_nothing_raised(ArgumentError) { + bar.class_eval { + mix foo + } + } + assert_equal(42, bar::D) + end end |