ruby-changes:19871
From: nobu <ko1@a...>
Date: Sat, 4 Jun 2011 11:36:26 +0900 (JST)
Subject: [ruby-changes:19871] nobu:r31918 (trunk): * test/ruby/test_module.rb (TestModule#test_mix_const): test for
nobu 2011-06-04 11:32:39 +0900 (Sat, 04 Jun 2011) New Revision: 31918 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31918 Log: * test/ruby/test_module.rb (TestModule#test_mix_const): test for constant mix. Modified files: trunk/test/ruby/test_module.rb Index: test/ruby/test_module.rb =================================================================== --- test/ruby/test_module.rb (revision 31917) +++ test/ruby/test_module.rb (revision 31918) @@ -1069,7 +1069,7 @@ 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 @@ } } 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/