summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_module.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-06 03:49:17 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-06 03:49:17 +0000
commiteebe08507c92b8cd3a12285294c960f8ec243ff3 (patch)
treea1a5628808492ab9f0843b309fdcf758a793ba4d /test/ruby/test_module.rb
parent675f125dc3fdc0c4d837998c3e84b5bc75ef566e (diff)
downloadruby-eebe08507c92b8cd3a12285294c960f8ec243ff3.tar.gz
ruby-eebe08507c92b8cd3a12285294c960f8ec243ff3.tar.xz
ruby-eebe08507c92b8cd3a12285294c960f8ec243ff3.zip
* test/ruby/test_module.rb (TestModule#test_mod_constants): should
not depend on global Module constants. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r--test/ruby/test_module.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 17fbf5633..072f559c3 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