summaryrefslogtreecommitdiff
path: root/spec/ruby/core/enumerator/lazy/shared/to_enum.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/enumerator/lazy/shared/to_enum.rb')
-rw-r--r--spec/ruby/core/enumerator/lazy/shared/to_enum.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/enumerator/lazy/shared/to_enum.rb b/spec/ruby/core/enumerator/lazy/shared/to_enum.rb
index a62a8ef90e..d488c9b263 100644
--- a/spec/ruby/core/enumerator/lazy/shared/to_enum.rb
+++ b/spec/ruby/core/enumerator/lazy/shared/to_enum.rb
@@ -47,4 +47,10 @@ describe :enumerator_lazy_to_enum, shared: true do
@infinite.send(method, *args).should be_an_instance_of(Enumerator::Lazy)
end
end
+
+ it "works with an infinite enumerable" do
+ s = 0..Float::INFINITY
+ s.lazy.send(@method, :with_index).first(100).should ==
+ s.first(100).to_enum.send(@method, :with_index).to_a
+ end
end