diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_object.rb | 25 |
1 files changed, 25 insertions, 0 deletions
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 } |