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
47
vendor/plugins/rspec/failing_examples/raising_example.rb
vendored
Normal file
47
vendor/plugins/rspec/failing_examples/raising_example.rb
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
describe "This example" do
|
||||
|
||||
it "should show that a NoMethodError is raised but an Exception was expected" do
|
||||
proc { ''.nonexistent_method }.should raise_error
|
||||
end
|
||||
|
||||
it "should pass" do
|
||||
proc { ''.nonexistent_method }.should raise_error(NoMethodError)
|
||||
end
|
||||
|
||||
it "should show that a NoMethodError is raised but a SyntaxError was expected" do
|
||||
proc { ''.nonexistent_method }.should raise_error(SyntaxError)
|
||||
end
|
||||
|
||||
it "should show that nothing is raised when SyntaxError was expected" do
|
||||
proc { }.should raise_error(SyntaxError)
|
||||
end
|
||||
|
||||
it "should show that a NoMethodError is raised but a Exception was expected" do
|
||||
proc { ''.nonexistent_method }.should_not raise_error
|
||||
end
|
||||
|
||||
it "should show that a NoMethodError is raised" do
|
||||
proc { ''.nonexistent_method }.should_not raise_error(NoMethodError)
|
||||
end
|
||||
|
||||
it "should also pass" do
|
||||
proc { ''.nonexistent_method }.should_not raise_error(SyntaxError)
|
||||
end
|
||||
|
||||
it "should show that a NoMethodError is raised when nothing expected" do
|
||||
proc { ''.nonexistent_method }.should_not raise_error(Exception)
|
||||
end
|
||||
|
||||
it "should show that the wrong message was received" do
|
||||
proc { raise StandardError.new("what is an enterprise?") }.should raise_error(StandardError, "not this")
|
||||
end
|
||||
|
||||
it "should show that the unexpected error/message was thrown" do
|
||||
proc { raise StandardError.new("abc") }.should_not raise_error(StandardError, "abc")
|
||||
end
|
||||
|
||||
it "should pass too" do
|
||||
proc { raise StandardError.new("abc") }.should_not raise_error(StandardError, "xyz")
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue