Hello RSpec group, is there a way to do RSpec-style shared behaviors in Cucumber? Or something similar? -- Posted via http://www.ruby-forum.com/.
You have Background in the new 0.2 version (not released yet) which lets you specify some Given steps for all the scenarios in a feature. Other than that there''s the super-steps, which also give you really nice re-use: http://blog.mattwynne.net/2008/11/14/dry-up-your-cucumber-steps/ On 6 Mar 2009, at 23:03, Sebastian W. wrote:> Hello RSpec group, is there a way to do RSpec-style shared behaviors > in > Cucumber? Or something similar? > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersMatt Wynne http://blog.mattwynne.net http://www.songkick.com
Matt Wynne wrote:> You have Background in the new 0.2 version (not released yet) which > lets you specify some Given steps for all the scenarios in a feature. > > Other than that there''s the super-steps, which also give you really > nice re-use: > http://blog.mattwynne.net/2008/11/14/dry-up-your-cucumber-steps/Plus you can use Scenario Outlines to DRY up similar scenarios: http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines -Ben> > > On 6 Mar 2009, at 23:03, Sebastian W. wrote: > >> Hello RSpec group, is there a way to do RSpec-style shared behaviors in >> Cucumber? Or something similar? >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > Matt Wynne > http://blog.mattwynne.net > http://www.songkick.com > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
On 6 Mar 2009, at 23:35, Ben Mabey wrote:> Matt Wynne wrote: >> You have Background in the new 0.2 version (not released yet) which >> lets you specify some Given steps for all the scenarios in a feature. >> >> Other than that there''s the super-steps, which also give you really >> nice re-use: >> http://blog.mattwynne.net/2008/11/14/dry-up-your-cucumber-steps/ > > Plus you can use Scenario Outlines to DRY up similar scenarios: > http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines > > -Ben*slaps forehead* thanks Ben - I missed the big hitter! Matt Wynne http://blog.mattwynne.net http://www.songkick.com