summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-08 03:06:13 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-08 03:06:13 +0000
commitd928280cb6644d2d899aadf7bfc8cf4e1b5e2997 (patch)
treec366adbd42bc4330b4009a5da44936e981c10c3d /test
parentdb051011d68950cd1261f91e724513282d419d9e (diff)
* eval.c (rb_mod_refine): raise an ArgumentError if a given
block is of a Proc object. * vm_insnhelper.c (vm_call_method): store refined methods in inline cache to improve performance. It's safe now because blocks cannot be yielded with different refinements in the new specification. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_refinement.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index 872ca1754a..05ac1030c5 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -616,6 +616,14 @@ class TestRefinement < Test::Unit::TestCase
assert_equal('[{"1":2},{"3":4}]', x)
end
+ def test_refine_with_proc
+ assert_raise(ArgumentError) do
+ Module.new {
+ refine(String, &Proc.new {})
+ }
+ end
+ end
+
private
def eval_using(mod, s)