diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-10 18:38:01 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-10 18:38:01 +0000 |
commit | fb9034e757da5ecdb79bb552233696779b54b9b7 (patch) | |
tree | 4becc175953f330e490285943c996dbf43682a5a /bootstraptest | |
parent | a52af292712cd527b155962feebbc79abfeb957f (diff) | |
download | ruby-fb9034e757da5ecdb79bb552233696779b54b9b7.tar.gz |
* bootstraptest/test_block.rb: add tests for block with super.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_block.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb index ea6768cc25..6a2ccfc6da 100644 --- a/bootstraptest/test_block.rb +++ b/bootstraptest/test_block.rb @@ -565,3 +565,35 @@ assert_normal_exit %q{ t.test_for_bug }, '[ruby-core:14395]' +assert_equal 'true', %q{ + class C0 + def foo + block_given? + end + end + + class C1 < C0 + def foo + super + end + end + + C1.new.foo{} +} + +assert_equal 'true', %q{ + class C0 + def foo + block_given? + end + end + + class C1 < C0 + def foo + super() + end + end + + C1.new.foo{} +} + |