From 235a2f90430944f733c2a8ffae8e9eab37d0584c Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 29 Sep 2007 03:11:24 +0000 Subject: add test for a define_method wrapper. git-svn-id: http://svn.ruby-lang.org/repos/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 259ebc21f..2bfdc1194 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 +} -- cgit