summaryrefslogtreecommitdiff
path: root/spec/ruby/core/enumerator/lazy/slice_when_spec.rb
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-21 15:38:59 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-21 15:38:59 +0000
commitda7976235fbc2986925969646071bebe3702e49f (patch)
tree83bbf6a8e03cf990369feabe6c1c9d45c69f4c85 /spec/ruby/core/enumerator/lazy/slice_when_spec.rb
parentb8e389a0f3226c90e96e02e6396686a3bef6a456 (diff)
Update to ruby/spec@7a16e01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/enumerator/lazy/slice_when_spec.rb')
-rw-r--r--spec/ruby/core/enumerator/lazy/slice_when_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/ruby/core/enumerator/lazy/slice_when_spec.rb b/spec/ruby/core/enumerator/lazy/slice_when_spec.rb
new file mode 100644
index 0000000000..e7673def47
--- /dev/null
+++ b/spec/ruby/core/enumerator/lazy/slice_when_spec.rb
@@ -0,0 +1,9 @@
+require_relative '../../../spec_helper'
+
+describe "Enumerator::Lazy#slice_when" do
+ it "works with an infinite enumerable" do
+ s = 0..Float::INFINITY
+ s.lazy.slice_when { |a, b| true }.first(100).should ==
+ s.first(100).slice_when { |a, b| true }.to_a
+ end
+end