Sha256: 26f831c6b18cf2840d58653013cdbd50ef6dd2467f8c620849d8f990c1e3298d
Contents?: true
Size: 1.05 KB
Versions: 5
Compression:
Stored size: 1.05 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require 'hamster/stack' describe Hamster::Stack do describe "#pop" do [ [["A", "B"], ["A"]], [["A", "B", "C"], ["A", "B"]], ].each do |values, expected| describe "on #{values.inspect}" do before do @original = Hamster.stack(*values) @result = @original.pop end it "preserves the original" do @original.should == Hamster.stack(*values) end it "returns #{expected.inspect}" do @result.should == Hamster.stack(*expected) end end end [ [], ["A"], ].each do |values| describe "on #{values.inspect}" do before do @original = Hamster.stack(*values) @result = @original.pop end it "preserves the original" do @original.should == Hamster.stack(*values) end it "returns the empty stack" do @result.should equal(Hamster.stack) end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems