1 require File.dirname(__FILE__) + '/spec_helper'
2 require File.dirname(__FILE__) + '/stack'
4 class StackExamples < Spec::ExampleGroup
11 class EmptyStackExamples < StackExamples
12 describe("when empty")
13 it "should be empty" do
14 @stack.should be_empty
18 class AlmostFullStackExamples < StackExamples
19 describe("when almost full")
21 (1..9).each {|n| @stack.push n}
23 it "should be full" do
24 @stack.should_not be_full
28 class FullStackExamples < StackExamples
31 (1..10).each {|n| @stack.push n}
33 it "should be full" do