Sha256: 23efa65a8ee569a411a856a928b9c97782d4e0ac548daf17a86b091905017e8f

Contents?: true

Size: 586 Bytes

Versions: 9

Compression:

Stored size: 586 Bytes

Contents

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

require 'hamster/stack'

describe Hamster do

  describe "#stack" do

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

      describe "on #{values}" do

        before do
          @original = Hamster.stack(*values)
          @result = @original.clear
        end

        it "preserves the original" do
          @original.should == Hamster.stack(*values)
        end

        it "returns an empty list" do
          @result.should be_empty
        end

      end

    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hamster-0.2.4 spec/hamster/stack/clear_spec.rb
hamster-0.2.3 spec/hamster/stack/clear_spec.rb
hamster-0.2.2 spec/hamster/stack/clear_spec.rb
hamster-0.2.1 spec/hamster/stack/clear_spec.rb
hamster-0.2.0 spec/hamster/stack/clear_spec.rb
hamster-0.1.23 spec/hamster/stack/clear_spec.rb
hamster-0.1.22 spec/hamster/stack/clear_spec.rb
hamster-0.1.21 spec/hamster/stack/clear_spec.rb
hamster-0.1.20 spec/hamster/stack/clear_spec.rb