mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
35b88be02b
commit
166a53c560
3 changed files with 37 additions and 8 deletions
|
@ -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 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue