[rspec-users] Cucumber: The Mysteries of Before(), After(), World() etc
dchelimsky at gmail.com
Wed Nov 12 08:59:22 EST 2008
On Wed, Nov 12, 2008 at 7:30 AM, aslak hellesoy
<aslak.hellesoy at gmail.com> wrote:
> On Wed, Nov 12, 2008 at 2:12 PM, Matt Wynne <matt at mattwynne.net> wrote:
>> My use case is that I want to be able to use a Logging::Logger within my
>> scenario code.
>> I can create the logger explicitly within the step block, but this is a
>> 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?
> Try this:
> World do
> world = Object.new
Or, since you're using Rails here:
returning Cucumber::Rails::World do |world|
>> 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.
>> rspec-users mailing list
>> rspec-users at rubyforge.org
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users