~ubuntu-branches/ubuntu/oneiric/puppet/oneiric-security

« back to all changes in this revision

Viewing changes to vendor/gems/rspec/examples/pure/nested_classes_example.rb

  • Committer: Bazaar Package Importer
  • Author(s): Micah Anderson
  • Date: 2008-07-26 15:43:45 UTC
  • mto: (3.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20080726154345-1fmgo76b4l72ulvc
ImportĀ upstreamĀ versionĀ 0.24.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require File.dirname(__FILE__) + '/spec_helper'
 
2
require File.dirname(__FILE__) + '/stack'
 
3
 
 
4
class StackExamples < Spec::ExampleGroup
 
5
  describe(Stack)
 
6
  before(:each) do
 
7
    @stack = Stack.new
 
8
  end
 
9
end
 
10
 
 
11
class EmptyStackExamples < StackExamples
 
12
  describe("when empty")
 
13
  it "should be empty" do
 
14
    @stack.should be_empty
 
15
  end
 
16
end
 
17
 
 
18
class AlmostFullStackExamples < StackExamples
 
19
  describe("when almost full")
 
20
  before(:each) do
 
21
    (1..9).each {|n| @stack.push n}
 
22
  end
 
23
  it "should be full" do
 
24
    @stack.should_not be_full
 
25
  end
 
26
end
 
27
 
 
28
class FullStackExamples < StackExamples
 
29
  describe("when full")
 
30
  before(:each) do
 
31
    (1..10).each {|n| @stack.push n}
 
32
  end
 
33
  it "should be full" do
 
34
    @stack.should be_full
 
35
  end
 
36
end
 
 
b'\\ No newline at end of file'