From 166a53c560aa24a1e16a9e1cb505bab5dff0462d Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 30 Oct 2009 07:57:21 +0000 Subject: * vm_eval.c (vm_call0, vm_call_super, rb_f_send, rb_f_public_send): fixed call_type. [ruby-dev:39581] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_object.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index 3980b5d41c..e90ca3b6d9 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -377,6 +377,31 @@ class TestObject < Test::Unit::TestCase assert_raise(ArgumentError) { 1.send } end + def test_no_superclass_method + bug2312 = '[ruby-dev:39581]' + + o = Object.new + e = assert_raise(NoMethodError) { + o.method(:__send__).call(:never_defined_test_no_superclass_method) + } + m1 = e.message + assert_no_match(/no superclass method/, m1, bug2312) + e = assert_raise(NoMethodError) { + o.method(:__send__).call(:never_defined_test_no_superclass_method) + } + assert_equal(m1, e.message, bug2312) + e = assert_raise(NoMethodError) { + o.never_defined_test_no_superclass_method + } + assert_equal(m1, e.message, bug2312) + end + + def test_superclass_method + bug2312 = '[ruby-dev:39581]' + assert_in_out_err(["-e", "module Enumerable;undef min;end; (1..2).min{}"], + [], [], /no superclass method/, bug2312) + end + def test_specific_eval_with_wrong_arguments assert_raise(ArgumentError) do 1.instance_eval("foo") { foo } -- cgit v1.2.1