diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-06 03:49:17 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-06 03:49:17 +0000 |
commit | 5e9cfca2d4fe158a9e2c5fac699b9dfe014b845f (patch) | |
tree | a1a5628808492ab9f0843b309fdcf758a793ba4d | |
parent | f4d37a3ff4c3fe4dfd82710e21d0e896e36650c0 (diff) | |
download | ruby-5e9cfca2d4fe158a9e2c5fac699b9dfe014b845f.tar.gz |
* test/ruby/test_module.rb (TestModule#test_mod_constants): should
not depend on global Module constants.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | test/ruby/test_module.rb | 9 |
2 files changed, 8 insertions, 4 deletions
@@ -3,6 +3,9 @@ Mon Oct 6 12:45:20 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * test/ruby/test_module.rb (TestModule#_wrap_assertion): add definition. is this really needed? + * test/ruby/test_module.rb (TestModule#test_mod_constants): should + not depend on global Module constants. + Mon Oct 6 12:38:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * lib/test/unit/assertions.rb (Test::Assertions#assert_nothing_raised): diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 17fbf56337..072f559c3c 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -544,10 +544,11 @@ class TestModule < Test::Unit::TestCase end def test_mod_constants - Module.const_set(:Foo, :foo) - assert_equal([:Foo], Module.constants(true)) - assert_equal([:Foo], Module.constants(false)) - Module.instance_eval { remove_const(:Foo) } + m = Module.new + m.const_set(:Foo, :foo) + assert_equal([:Foo], m.constants(true)) + assert_equal([:Foo], m.constants(false)) + m.instance_eval { remove_const(:Foo) } end def test_frozen_class |