mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-21 09:40:13 +01:00
Added Rspec and Webrat plugins and started porting Selenium on Rails tests to Rspec Plain Text Stories driving Webrat driving Selenium.
This commit is contained in:
parent
0600756bbf
commit
0f7d6f7a1d
602 changed files with 47788 additions and 29 deletions
38
vendor/plugins/rspec/examples/pure/shared_stack_examples.rb
vendored
Normal file
38
vendor/plugins/rspec/examples/pure/shared_stack_examples.rb
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
require File.join(File.dirname(__FILE__), *%w[spec_helper])
|
||||
|
||||
shared_examples_for "non-empty Stack" do
|
||||
|
||||
it { @stack.should_not be_empty }
|
||||
|
||||
it "should return the top item when sent #peek" do
|
||||
@stack.peek.should == @last_item_added
|
||||
end
|
||||
|
||||
it "should NOT remove the top item when sent #peek" do
|
||||
@stack.peek.should == @last_item_added
|
||||
@stack.peek.should == @last_item_added
|
||||
end
|
||||
|
||||
it "should return the top item when sent #pop" do
|
||||
@stack.pop.should == @last_item_added
|
||||
end
|
||||
|
||||
it "should remove the top item when sent #pop" do
|
||||
@stack.pop.should == @last_item_added
|
||||
unless @stack.empty?
|
||||
@stack.pop.should_not == @last_item_added
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
shared_examples_for "non-full Stack" do
|
||||
|
||||
it { @stack.should_not be_full }
|
||||
|
||||
it "should add to the top when sent #push" do
|
||||
@stack.push "newly added top item"
|
||||
@stack.peek.should == "newly added top item"
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue