From bf1a04b191f80ecbe65ea0e45630f77630a25aa9 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 4 Jun 2011 02:32:39 +0000 Subject: [PATCH] * test/ruby/test_module.rb (TestModule#test_mix_const): test for constant mix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_module.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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