Forum: RSpec [cucumber] getting scenario name in hook

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Tim W. (Guest)
on 2009-03-11 17:14
(Received via mailing list)
Hi Guys,

If I am generating diagnostics from a before do step can I get the
name of the scenario?

Many thanks,

Tim
Aslak H. (Guest)
on 2009-03-11 18:29
(Received via mailing list)
On Wed, Mar 11, 2009 at 4:12 PM, Tim W. <removed_email_address@domain.invalid> 
wrote:

> Hi Guys,
>
> If I am generating diagnostics from a before do step can I get the
> name of the scenario?
>

This is implemented in 0.1.99.x:
http://rspec.lighthouseapp.com/projects/16211-cucu...

Aslak
Tim W. (Guest)
on 2009-03-12 02:44
(Received via mailing list)
That did the trick. Thanks Aslak! Took a little while to figure out
where it was in the Scenario object but it was pretty straight forward
from there.

T

On Wed, Mar 11, 2009 at 10:21 AM, aslak hellesoy
Nigel T. (Guest)
on 2009-03-20 05:42
(Received via mailing list)
Where in the scenario object is the name stored?

Cheers.
Nigel


walketim wrote:
>>
>> Aslak
>>
>
--
View this message in context:
http://www.nabble.com/-cucumber--getting-scenario-...
Sent from the rspec-users mailing list archive at Nabble.com.
Tim W. (Guest)
on 2009-03-20 18:48
(Received via mailing list)
We're accessing it like this....

Before do |scenario|
  puts "Before Scenario: #{scenario.to_sexp[3]}"
  .
  .
  .
 end

HTH,

Tim
Aslak H. (Guest)
on 2009-03-20 23:18
(Received via mailing list)
On Fri, Mar 20, 2009 at 12:26 PM, Tim W. <removed_email_address@domain.invalid> 
wrote:

> We're accessing it like this....
>
> Before do |scenario|
>  puts "Before Scenario: #{scenario.to_sexp[3]}"
>  .
>  .
>  .
>  end
>

I like that even if it's a little convoluted - I'm trying to avoid
exposing
every single attribute.

Aslak
Nigel T. (Guest)
on 2009-03-21 14:24
(Received via mailing list)
That is exactly what I was looking for.. Thank you !




2009/3/21 Tim W. <removed_email_address@domain.invalid>:
This topic is locked and can not be replied to.