From 9603cd2f627013d50a40419e2283752346a15c99 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 3 Oct 2009 12:19:19 +0000 Subject: * vm_method.c (rb_add_method_def): no redefinition warning on undef. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_class.rb | 10 +++++++++- test/ruby/test_module.rb | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index 409fc49e4e..8fe1272314 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -150,7 +150,15 @@ class TestClass < Test::Unit::TestCase Class.new do define_method(:foo) do end alias bar foo - alias barf oo + alias bar foo + end + end + assert_equal("", stderr) + + stderr = EnvUtil.verbose_warning do + Class.new do + def foo; end + undef foo end end assert_equal("", stderr) diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index c50cd38b79..59c965325f 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -845,5 +845,13 @@ class TestModule < Test::Unit::TestCase end end assert_equal("", stderr, '[ruby-dev:39397]') + + stderr = EnvUtil.verbose_warning do + Module.new do + def foo; end + undef foo + end + end + assert_equal("", stderr) end end -- cgit v1.2.3