[rspec-users] Cucumber Custom Logging

James Byrne lists at ruby-forum.com
Mon Nov 24 15:35:14 EST 2008

aslak hellesoy wrote:
> On Mon, Nov 24, 2008 at 9:00 PM, James Byrne <lists at ruby-forum.com> 
> wrote:
>> > or other?
>> Rails 2.2.2
> It depends what you want to log and when. Have you tried to put it in a
> Before or After block?
> I'm not sure exactly what you're trying to achieve.
> Aslak

I am looking for where in hierarchy to put a global logger command that 
will apply to each scenario and/or step, and probably what form the 
command should take.  I want to provide a text delimiter within 
log/test.log to identify what activity takes place behind the curtains 
when each scenario and step is run.  Something like.

  logger.info("Running Scenario: #{scenario}"
  logger.info("  Running Step: #{step}"

I tried to make sense out of the discussion surrounding ticket:


Truth be told, I can only dimly grasp at what is going on.  It seems 
that the place to put something like I seek would be in features/support 
or features itself.  I gather that before / after block only work within 
step files? If so then that requires each step file be modified to turn 
custom logging on or off, which is something I would much rather avoid.

Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list