spec/hamster/stack/copying_spec.rb in hamster-0.1.12 vs spec/hamster/stack/copying_spec.rb in hamster-0.1.13

- old
+ new

@@ -1,18 +1,24 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') describe Hamster::Stack do - before do - @stack = Hamster.stack.push("A").push("B").push("C") - end - [:dup, :clone].each do |method| - describe "##{method}" do + [ + [], + ["A"], + ["A", "B", "C"], + ].each do |values| - it "returns self" do - @stack.send(method).should equal(@stack) + describe "on #{values.inspect}" do + + stack = Hamster.stack(*values) + + it "returns self" do + stack.send(method).should equal(stack) + end + end end end