diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-14 07:42:43 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-14 07:42:43 +0000 |
commit | 8ca504214d8a20bdda05b65016812fa7234faad4 (patch) | |
tree | 5c23c1b9ca2f01c8c01d7b21d0b7c54fd87debdf /test | |
parent | a4665e30f72bc42a9b12b8751ce73ad282ccc5f6 (diff) | |
download | ruby-8ca504214d8a20bdda05b65016812fa7234faad4.tar.gz |
* enumerator.c: Require block for Lazy#{take|drop}_while [Bug #7692]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_lazy_enumerator.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index 7576c942a5..30677291f4 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -363,4 +363,10 @@ EOS assert_ruby_status(["-e", "GC.stress = true", "-e", "(1..10).lazy.map{}.zip(){}"], bug7507) assert_ruby_status(["-e", "GC.stress = true", "-e", "(1..10).lazy.map{}.zip().to_a"], bug7507) end + + def test_require_block + %i[select reject drop_while take_while].each do |method| + assert_raise(ArgumentError){ [].lazy.send(method) } + end + end end |