[rspec-users] Cucumber: The Mysteries of Before(), After(), World() etc

Matt Wynne matt at mattwynne.net
Wed Nov 12 08:12:48 EST 2008

My use case is that I want to be able to use a Logging::Logger[1]  
within my scenario code.

I can create the logger explicitly within the step block, but this is  
a hackaround.

I think I could monkey-patch Cucumber::Rails::World to include my  
logger, but that also feels dirty.

Is there a nice clean way I can use on of the above (AFAIK  
undocumented) methods to help me?

Better, is there some documentation / a blog post I can be pointed to  
so I can help myself? I have had a pretty thorough read of the code  
but I'm not quite there yet with my Ruby to make sufficient sense of it.


More information about the rspec-users mailing list