Sha256: d8e1070253621040e7e0718c0102371e989c5326884a37b36f904b102a51429e

Contents?: true

Size: 367 Bytes

Versions: 5

Compression:

Stored size: 367 Bytes

Contents

covers 'facets/enumerator'

test_case Enumerator do

  class_method :new do

    test "with block" do
      # This example taken from ri19 Enumerator.new
      fib = Enumerator.new do |y|
       a = b = 1
        loop {
          y << a
          a, b = b, a + b
        }
      end
      fib.take(10).assert == [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
    end

  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 test/core/enumerator/test_new.rb
facets-3.1.0 test/core/enumerator/test_new.rb
facets-3.0.0 test/core/enumerator/test_new.rb
facets-2.9.3 test/core/enumerator/test_new.rb
facets-2.9.2 test/core/enumerator/test_new.rb