summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-30 07:57:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-30 07:57:21 +0000
commit166a53c560aa24a1e16a9e1cb505bab5dff0462d (patch)
treebcfb4b6ffc383dbe5ea67419d00bcfd3983f1399 /test/ruby
parent35b88be02b246357368dbcd5cdc83bf1dabef425 (diff)
downloadruby-166a53c560aa24a1e16a9e1cb505bab5dff0462d.tar.gz
* 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
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_object.rb25
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 }