Hi Guys, If I am generating diagnostics from a before do step can I get the name of the scenario? Many thanks, Tim
aslak hellesoy
2009-Mar-11 16:21 UTC
[rspec-users] [cucumber] getting scenario name in hook
On Wed, Mar 11, 2009 at 4:12 PM, Tim Walker <walketim at gmail.com> 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-cucumber/tickets/44 Aslak> > Many thanks, > > Tim > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090311/9066344f/attachment.html>
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 <aslak.hellesoy at gmail.com> wrote:> > > On Wed, Mar 11, 2009 at 4:12 PM, Tim Walker <walketim at gmail.com> 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-cucumber/tickets/44 > > Aslak > >> >> Many thanks, >> >> Tim >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Where in the scenario object is the name stored? Cheers. Nigel walketim wrote:> > 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 > <aslak.hellesoy at gmail.com> wrote: >> >> >> On Wed, Mar 11, 2009 at 4:12 PM, Tim Walker <walketim at gmail.com> 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-cucumber/tickets/44 >> >> Aslak >> >>> >>> Many thanks, >>> >>> Tim >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >> >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > >-- View this message in context: http://www.nabble.com/-cucumber--getting-scenario-name-in-hook-tp22457271p22613814.html Sent from the rspec-users mailing list archive at Nabble.com.
We''re accessing it like this.... Before do |scenario| puts "Before Scenario: #{scenario.to_sexp[3]}" . . . end HTH, Tim On Thu, Mar 19, 2009 at 9:39 PM, Nigel Thorne <rspec at nigelthorne.com> wrote:> > Where in the scenario object is the name stored? > > Cheers. > Nigel > > > walketim wrote: >> >> 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 >> <aslak.hellesoy at gmail.com> wrote: >>> >>> >>> On Wed, Mar 11, 2009 at 4:12 PM, Tim Walker <walketim at gmail.com> 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-cucumber/tickets/44 >>> >>> Aslak >>> >>>> >>>> Many thanks, >>>> >>>> Tim >>>> _______________________________________________ >>>> rspec-users mailing list >>>> rspec-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >>> >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> >> > > -- > View this message in context: http://www.nabble.com/-cucumber--getting-scenario-name-in-hook-tp22457271p22613814.html > Sent from the rspec-users mailing list archive at Nabble.com. > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
aslak hellesoy
2009-Mar-20 20:15 UTC
[rspec-users] [cucumber] getting scenario name in hook
On Fri, Mar 20, 2009 at 12:26 PM, Tim Walker <walketim at gmail.com> 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> > HTH, > > Tim > > On Thu, Mar 19, 2009 at 9:39 PM, Nigel Thorne <rspec at nigelthorne.com> > wrote: > > > > Where in the scenario object is the name stored? > > > > Cheers. > > Nigel > > > > > > walketim wrote: > >> > >> 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 > >> <aslak.hellesoy at gmail.com> wrote: > >>> > >>> > >>> On Wed, Mar 11, 2009 at 4:12 PM, Tim Walker <walketim at gmail.com> > 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-cucumber/tickets/44 > >>> > >>> Aslak > >>> > >>>> > >>>> Many thanks, > >>>> > >>>> Tim > >>>> _______________________________________________ > >>>> rspec-users mailing list > >>>> rspec-users at rubyforge.org > >>>> http://rubyforge.org/mailman/listinfo/rspec-users > >>> > >>> > >>> _______________________________________________ > >>> rspec-users mailing list > >>> rspec-users at rubyforge.org > >>> http://rubyforge.org/mailman/listinfo/rspec-users > >>> > >> _______________________________________________ > >> rspec-users mailing list > >> rspec-users at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/rspec-users > >> > >> > > > > -- > > View this message in context: > http://www.nabble.com/-cucumber--getting-scenario-name-in-hook-tp22457271p22613814.html > > Sent from the rspec-users mailing list archive at Nabble.com. > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Aslak (::) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090320/77f37b78/attachment.html>
That is exactly what I was looking for.. Thank you ! 2009/3/21 Tim Walker <walketim at gmail.com>:> We''re accessing it like this.... > > Before do |scenario| > ?puts "Before Scenario: #{scenario.to_sexp[3]}" > ?. > ?. > ?. > ?end > > HTH, > > Tim > > On Thu, Mar 19, 2009 at 9:39 PM, Nigel Thorne <rspec at nigelthorne.com> wrote: >> >> Where in the scenario object is the name stored? >> >> Cheers. >> Nigel >> >> >> walketim wrote: >>> >>> 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 >>> <aslak.hellesoy at gmail.com> wrote: >>>> >>>> >>>> On Wed, Mar 11, 2009 at 4:12 PM, Tim Walker <walketim at gmail.com> 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-cucumber/tickets/44 >>>> >>>> Aslak >>>> >>>>> >>>>> Many thanks, >>>>> >>>>> Tim >>>>> _______________________________________________ >>>>> rspec-users mailing list >>>>> rspec-users at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/rspec-users >>>> >>>> >>>> _______________________________________________ >>>> rspec-users mailing list >>>> rspec-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/rspec-users >>>> >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >>> >> >> -- >> View this message in context: http://www.nabble.com/-cucumber--getting-scenario-name-in-hook-tp22457271p22613814.html >> Sent from the rspec-users mailing list archive at Nabble.com. >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >