Sha256: afc3881c06a0850702cfdd643959ef52ec308b9c9fd249e5fe3e328121ab8af4

Contents?: true

Size: 539 Bytes

Versions: 12

Compression:

Stored size: 539 Bytes

Contents

require File.expand_path('../../../spec_helper', __FILE__)

require 'hamster/core_ext/enumerable'

describe Enumerable do

  class TestEnumerable

    include Enumerable

    def initialize(*values)
      @values = values
    end

    def each(&block)
      @values.each(&block)
    end

  end

  describe "#to_list" do

    before do
      enumerable = TestEnumerable.new("A", "B", "C")
      @list = enumerable.to_list
    end

    it "returns an equivalent list" do
      @list.should == Hamster.list("A", "B", "C")
    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hamster-0.3.6 spec/hamster/core_ext/enumerable_spec.rb
hamster-0.3.5 spec/hamster/core_ext/enumerable_spec.rb
hamster-0.3.4 spec/hamster/core_ext/enumerable_spec.rb
hamster-0.3.3 spec/hamster/core_ext/enumerable_spec.rb
hamster-0.3.2 spec/hamster/core_ext/enumerable_spec.rb
hamster-0.3.1 spec/hamster/core_ext/enumerable_spec.rb
hamster-0.3.0 spec/hamster/core_ext/enumerable_spec.rb
hamster-0.2.13 spec/hamster/core_ext/enumerable_spec.rb
hamster-0.2.12 spec/hamster/core_ext/enumerable_spec.rb
hamster-0.2.11 spec/hamster/core_ext/enumerable_spec.rb
hamster-0.2.9 spec/hamster/core_ext/enumerable_spec.rb
hamster-0.2.8 spec/hamster/core_ext/enumerable_spec.rb