diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-26 04:26:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-26 04:26:09 +0000 |
commit | 9a4185de2581fc826d3c4687e210c9264e2dae5b (patch) | |
tree | 7b400f2d28835ff3c2382588b638640bb8d85373 /test/ruby/test_module.rb | |
parent | a2fb6e600cc3530ee481efa52521220338e4d6ee (diff) |
envutil.rb: move labeled_module and labeled_class
* test/ruby/envutil.rb (labeled_module, labeled_class): move from
test/ruby/test_module.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r-- | test/ruby/test_module.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 5eb0457496..02739dd520 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1564,17 +1564,11 @@ class TestModule < Test::Unit::TestCase end def labeled_module(name, &block) - Module.new do - singleton_class.class_eval {define_method(:to_s) {name}; alias inspect to_s} - class_eval(&block) if block - end + EnvUtil.labeled_module(name, &block) end def labeled_class(name, superclass = Object, &block) - Class.new(superclass) do - singleton_class.class_eval {define_method(:to_s) {name}; alias inspect to_s} - class_eval(&block) if block - end + EnvUtil.labeled_class(name, superclass, &block) end def test_prepend_instance_methods_false |