summaryrefslogtreecommitdiff
path: root/spec/ruby/core/enumerator/lazy/slice_before_spec.rb
blob: 6c8660c1a14e6db741fa5a6b8701a5bfacef0801 (plain)
1
2
3
4
5
6
7
8
9
require_relative '../../../spec_helper'

describe "Enumerator::Lazy#slice_before" do
  it "works with an infinite enumerable" do
    s = 0..Float::INFINITY
    s.lazy.slice_before { |n| true }.first(100).should ==
      s.first(100).slice_before { |n| true }.to_a
  end
end