Sha256: 4e045c7bc0609949e4a3f6c21db87a06e3b62a1d5a7921d11a9453845b0849ae

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

require "spec_helper"

require "hamster/queue"
require "hamster/list"

describe Hamster::Queue do

  describe "#to_list" do

    [
      [],
      ["A"],
      %w[A B C],
    ].each do |values|

      describe "on #{values.inspect}" do

        before do
          @list = Hamster.queue(*values).to_list
        end

        it "returns a list containing #{values.inspect}" do
          @list.should == Hamster.list(*values)
        end

      end

    end

    describe "after dequeueing an item from #{%w[A B C].inspect}" do

      before do
        @list = Hamster.queue("A", "B", "C").dequeue.to_list
      end

      it "returns a list containing #{%w[B C].inspect}" do
        @list.should == Hamster.list("B", "C")
      end

    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hamster-1.0.1.pre.rc.1 spec/hamster/queue/to_list_spec.rb