From 2d6ad7e11875aca83123fb98aa82a3c4428ed941 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 29 Sep 2007 03:11:24 +0000 Subject: [PATCH] add test for a define_method wrapper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bootstraptest/test_knownbug.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb index 259ebc21ff..2bfdc11942 100644 --- a/bootstraptest/test_knownbug.rb +++ b/bootstraptest/test_knownbug.rb @@ -13,3 +13,18 @@ assert_finish 1, %q{ w.write "a" }, '[ruby-dev:31866]' +assert_equal 'ok', %q{ + class Module + def define_method2(name, &block) + define_method(name, &block) + end + end + class C + define_method2(:m) {|x, y| :fail } + end + begin + C.new.m([1,2]) + rescue ArgumentError + :ok + end +}