spec/hamster/stack/pop_spec.rb in hamster-0.3.10 vs spec/hamster/stack/pop_spec.rb in hamster-0.4.0
- old
+ new
@@ -7,10 +7,12 @@
[:pop, :dequeue].each do |method|
describe "##{method}" do
[
+ [[], []],
+ [["A"], []],
[["A", "B"], ["A"]],
[["A", "B", "C"], ["A", "B"]],
].each do |values, expected|
describe "on #{values.inspect}" do
@@ -24,33 +26,9 @@
@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.send(method)
- end
-
- it "preserves the original" do
- @original.should == Hamster.stack(*values)
- end
-
- it "returns an empty stack" do
- @result.should be_empty
end
end
end