diff options
Diffstat (limited to 'spec/ruby/core/enumerator/lazy/chunk_spec.rb')
-rw-r--r-- | spec/ruby/core/enumerator/lazy/chunk_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/enumerator/lazy/chunk_spec.rb b/spec/ruby/core/enumerator/lazy/chunk_spec.rb index 246dd72712..3f60c6ea3f 100644 --- a/spec/ruby/core/enumerator/lazy/chunk_spec.rb +++ b/spec/ruby/core/enumerator/lazy/chunk_spec.rb @@ -68,4 +68,10 @@ describe "Enumerator::Lazy#chunk" do end end end + + it "works with an infinite enumerable" do + s = 0..Float::INFINITY + s.lazy.chunk { |n| n.even? }.first(100).should == + s.first(100).chunk { |n| n.even? }.to_a + end end |