added RSpec and RSpec on Rails
This commit is contained in:
parent
ddd5b4cf19
commit
3f607d565b
316 changed files with 23828 additions and 0 deletions
36
vendor/gems/rspec-1.1.2/examples/pure/nested_classes_example.rb
vendored
Normal file
36
vendor/gems/rspec-1.1.2/examples/pure/nested_classes_example.rb
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
require File.dirname(__FILE__) + '/spec_helper'
|
||||
require File.dirname(__FILE__) + '/stack'
|
||||
|
||||
class StackExamples < Spec::ExampleGroup
|
||||
describe(Stack)
|
||||
before(:each) do
|
||||
@stack = Stack.new
|
||||
end
|
||||
end
|
||||
|
||||
class EmptyStackExamples < StackExamples
|
||||
describe("when empty")
|
||||
it "should be empty" do
|
||||
@stack.should be_empty
|
||||
end
|
||||
end
|
||||
|
||||
class AlmostFullStackExamples < StackExamples
|
||||
describe("when almost full")
|
||||
before(:each) do
|
||||
(1..9).each {|n| @stack.push n}
|
||||
end
|
||||
it "should be full" do
|
||||
@stack.should_not be_full
|
||||
end
|
||||
end
|
||||
|
||||
class FullStackExamples < StackExamples
|
||||
describe("when full")
|
||||
before(:each) do
|
||||
(1..10).each {|n| @stack.push n}
|
||||
end
|
||||
it "should be full" do
|
||||
@stack.should be_full
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue