Sha256: 6bc760d2882f7fc4f245728dfed49e6237b96c2fb58a39c7ec6f862b1dd85a1a

Contents?: true

Size: 777 Bytes

Versions: 1

Compression:

Stored size: 777 Bytes

Contents

require "spec_helper"

require "hamster/queue"

describe Hamster::Queue do

  [:empty?, :null?].each do |method|

    describe "##{method}" do

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

        describe "on #{values.inspect}" do

          before do
            @result = Hamster.queue(*values).send(method)
          end

          it "returns #{expected.inspect}" do
            @result.should == expected
          end

        end

      end

    end

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

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

      it "returns false" do
        @result.should_not be_empty
      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/empty_spec.rb