[rspec-users] Cucumber Custom Logging

James Byrne lists at ruby-forum.com
Mon Nov 24 16:26:27 EST 2008


Joseph Wilk wrote:
> 
> I don't think this is the case. Every Before/After that is in a required 
> file is run before a scenario. So in theory you could create one Before 
> (in for example env.rb) which would get called for all scenarios.
> 

I experimented with the following code in env.rb, borrowing heavily from 
the discussion on ticker 44 and this is what happened:

Before do |scenario|
  logger.info("Running Scenario: #{scenario}")
end

  Scenario: Record Entity basic identification information  # 
features/entities/entity.feature:12
/usr/lib/ruby/gems/1.8/gems/cucumber-0.1.9/bin/../lib/cucumber/core_ext/proc.rb:15:in 
`call_in': expected 1 block argument(s), got 0 
(Cucumber::ArityMismatchError)
        from 
/usr/lib/ruby/gems/1.8/gems/cucumber-0.1.9/bin/../lib/cucumber/executor.rb:91:in 
`execute_scenario'

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


More information about the rspec-users mailing list