Sha256: 9a846fbc9dc5a1aeb153b7020c5bed47fddcc77db909de29baca8f9fe570941e

Contents?: true

Size: 792 Bytes

Versions: 2

Compression:

Stored size: 792 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe Hamster do

  describe ".stack" do

    describe "with no arguments" do

      before do
        @stack = Hamster.stack
      end

      it "always returns the same instance" do
        @stack.should equal(Hamster.stack)
      end

      it "returns an empty stack" do
        @stack.should be_empty
      end

    end

    describe "with a number of items" do

      before do
        @stack = Hamster.stack("A", "B", "C")
      end

      it "always returns a different instance" do
        @stack.should_not equal(Hamster.stack("A", "B", "C"))
      end

      it "is the same as repeatedly using #push" do
        @stack.should == Hamster.stack.push("A").push("B").push("C")
      end

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hamster-0.1.14 spec/hamster/stack/construction_spec.rb
hamster-0.1.13 spec/hamster/stack/construction_spec.rb