diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-04 02:32:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-04 02:32:39 +0000 |
commit | bf1a04b191f80ecbe65ea0e45630f77630a25aa9 (patch) | |
tree | 2d01bf1dd5a278f96c454cde145bc4f468e64ad5 /test/ruby | |
parent | 40930b71445a08d0d9a16681ba20cb8a68a7e3a0 (diff) | |
download | ruby-bf1a04b191f80ecbe65ea0e45630f77630a25aa9.tar.gz |
* 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
Diffstat (limited to 'test/ruby')
-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 |