Sha256: 37de62f1a0379f58ef37af8dd01c04dc5d6a413d7b6f642ed5a1dba41a5e99e7
Contents?: true
Size: 871 Bytes
Versions: 15
Compression:
Stored size: 871 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require 'hamster/stack' describe Hamster::Stack do [:push, :<<].each do |method| describe "##{method}" do [ [[], "A", ["A"]], [["A"], "B", ["A", "B"]], [["A"], "A", ["A", "A"]], [["A", "B", "C"], "D", ["A", "B", "C", "D"]], ].each do |values, new_value, expected| describe "on #{values.inspect} with #{new_value.inspect}" do before do @original = Hamster.stack(*values) @result = @original.send(method, new_value) 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 end end end
Version data entries
15 entries across 15 versions & 1 rubygems