Jim Morris
2009-May-01 20:21 UTC
[rspec-users] [Cucumber] how to get name from scenario hook?
Hi, Given the hook: After do |scenario| end How do I get the name of the scenario from the scenario parameter? scenario.name doesn''t work, and I looked through the source code and it was not immediately obvious to me. Thanks
wolfmanjm
2009-May-01 23:03 UTC
[rspec-users] [Cucumber] how to get name from scenario hook?
to_sexp should do it for now, but I''ll file a ticket as #name would be useful. Thanks On May 1, 2:51?pm, aslak hellesoy <aslak.helle... at gmail.com> wrote:> > Hi, > > > Given the hook: > > > After do |scenario| > > > end > > > How do I get the name of the scenario from the scenario parameter? > > > scenario.name doesn''t ?work, and I looked through the source code and > > it was not immediately obvious to me. > > You can call to_sexp on it and get it from there. Or you can file a > Lighthouse ticket if you want the #name accessor. > > > > > Thanks > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/rspec-users > > > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
wolfmanjm
2009-May-02 04:02 UTC
[rspec-users] [Cucumber] how to get name from scenario hook?
filed the ticket, as it turns out that the name is not available in the sexp for scenario outlines. Thanks On May 1, 4:03?pm, wolfmanjm <wolfma... at gmail.com> wrote:> to_sexp should do it for now, but I''ll file a ticket as #name would be > useful. > > Thanks > > On May 1, 2:51?pm, aslak hellesoy <aslak.helle... at gmail.com> wrote: > > > > Hi, > > > > Given the hook: > > > > After do |scenario| > > > > end > > > > How do I get the name of the scenario from the scenario parameter? > > > > scenario.name doesn''t ?work, and I looked through the source code and > > > it was not immediately obvious to me. > > > You can call to_sexp on it and get it from there. Or you can file a > > Lighthouse ticket if you want the #name accessor. > > > > Thanks > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-us... at rubyforge.org > > >http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users