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

Luke Melia luke at lukemelia.com
Wed May 20 01:21:35 EDT 2009


On May 19, 2009, at 10:43 PM, Luke Melia wrote:

> On May 19, 2009, at 7:04 PM, aslak hellesoy wrote:
>
>> I'm convinced. We'll add an AfterStep hook. Do you want to give a  
>> stab
>> at a patch? Start by writing a feature - see
>> features/after_block_exceptions.feature for a good example of the
>> style we like...
>
> Sounds good. I'll give it a whirl tonight.

Here's my first pass:

http://github.com/weplay/cucumber/commit/39601bc5eb6f0761dd7bedddc5484cdd895ca787

Not crazy about the way it tracks the current_scenario or the  
exception_fails_scenario parameter on Hook#execute_in. Unlike Before  
and After hooks, I think it's preferable for AfterStep to fail the  
step than to call scenario.fail!

Thoughts?

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



More information about the rspec-users mailing list