[rspec-users] Cucumber Custom Logging

Joseph Wilk lists at ruby-forum.com
Tue Nov 25 06:57:27 EST 2008

James Byrne wrote:
> 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

The patch that you are referring to in ticket #44 has not been merged 
in. So passing a block to scenario is not currently possible.

Joseph Wilk

>   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