[rspec-users] [Cucumber] Fail a scenario from After or AfterStep

Luke Melia luke at lukemelia.com
Fri May 15 02:01:25 EDT 2009


I'm trying to make sure that my cucumber selenium suite fails if my  
Rails app returns any 500 response codes. I'm working on what the best  
way to identify this state, but the question I'd like to put to the  
list is this: If I want to check for this error condition in an After  
or AfterStep, how can I force a failure in the scenario?

i.e. something like the following non-functional snippet:

AfterStep do |scenario|
   if foo_error_state_detected?
     scenario.fail("A foo failure has been detected.")
   end
end

Ideas?

TIA,
Luke
--
Luke Melia
luke at lukemelia.com
http://www.lukemelia.com/



More information about the rspec-users mailing list