diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-10 06:01:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-10 06:01:32 +0000 |
commit | 33a75edd3cf6062796043ae75747b4b191db3789 (patch) | |
tree | ec79ebc0c2e3b8fe14a7b410702211464fa6c08e /test/ruby | |
parent | 671ef4e9e3d8cb3c397547934902a6a4fd312816 (diff) | |
download | ruby-33a75edd3cf6062796043ae75747b4b191db3789.tar.gz |
proc.c: check if callable
* proc.c: check the argument at composition, expect a Proc,
Method, or callable object. [ruby-core:90591] [Bug #15428]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_method.rb | 4 | ||||
-rw-r--r-- | test/ruby/test_proc.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index 5cfcdb8dc5..82a1b71d32 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -1088,10 +1088,10 @@ class TestMethod < Test::Unit::TestCase } f = c.new.method(:f) - assert_raise(NoMethodError) { + assert_raise(TypeError) { (f << 5).call(2) } - assert_raise(NoMethodError) { + assert_raise(TypeError) { (f >> 5).call(2) } end diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index 8e8f719892..4abe0aa1bb 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -1474,10 +1474,10 @@ class TestProc < Test::Unit::TestCase def test_compose_with_noncallable f = proc {|x| x * 2} - assert_raise(NoMethodError) { + assert_raise(TypeError) { (f << 5).call(2) } - assert_raise(NoMethodError) { + assert_raise(TypeError) { (f >> 5).call(2) } end |