summaryrefslogtreecommitdiffstats
path: root/bootstraptest/test_block.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-25 02:14:36 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-25 02:14:36 +0000
commit34d287c10aca44f4dd20b3ff128c97c76edcbfc9 (patch)
treeb47aae37fe4eb80d8ecc564ec2563db807d4d910 /bootstraptest/test_block.rb
parent02b8d548da9dc72271019423cf49e612e6e7ed8d (diff)
downloadruby-34d287c10aca44f4dd20b3ff128c97c76edcbfc9.tar.gz
ruby-34d287c10aca44f4dd20b3ff128c97c76edcbfc9.tar.xz
ruby-34d287c10aca44f4dd20b3ff128c97c76edcbfc9.zip
* vm.c: check frame is FINAL when creating env.
[ruby-core:14395] * bootstraptest/test_block.rb: add a test for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/test_block.rb')
-rw-r--r--bootstraptest/test_block.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb
index 3ece21756..2db149063 100644
--- a/bootstraptest/test_block.rb
+++ b/bootstraptest/test_block.rb
@@ -507,3 +507,43 @@ assert_equal "ok", %q{
end
foo(&:bar)
}, '[ruby-core:14279]'
+
+assert_normal_exit %q{
+ class Controller
+ def respond_to(&block)
+ responder = Responder.new
+ block.call(responder)
+ responder.respond
+ end
+ def test_for_bug
+ respond_to{|format|
+ format.js{
+ puts "in test"
+ render{|obj|
+ puts obj
+ }
+ }
+ }
+ end
+ def render(&block)
+ puts "in render"
+ end
+ end
+
+ class Responder
+ def method_missing(symbol, &block)
+ puts "enter method_missing"
+ @response = Proc.new{
+ puts 'in method missing'
+ block.call
+ }
+ puts "leave method_missing"
+ end
+ def respond
+ @response.call
+ end
+ end
+ t = Controller.new
+ t.test_for_bug
+}, '[ruby-core:14395]'
+