Hi, I am currently moving over my Watir Story Runner tests over to Cucumber. However, I have a verification_steps.rb that holds these two steps Then "the user is at ''$title'' page" do |title| browser.wait_until_includes(title) end Given "the user is at ''$title'' page" do |title| browser.wait_until_includes(title) end I think these *are* both valid ''Whens'' and ''Thens'', but I am getting a duplicate error from Cucumber. Any opinions or suggestions please? Aidy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080923/e3178c3b/attachment.html>
David Chelimsky
2008-Sep-23 16:31 UTC
[rspec-users] Story Runner => Cucumber(duplicate steps)!
On Tue, Sep 23, 2008 at 11:18 AM, aidy lewis <aidy.lewis at googlemail.com> wrote:> Hi, > > I am currently moving over my Watir Story Runner tests over to Cucumber. > > However, I have a verification_steps.rb that holds these two steps > > Then "the user is at ''$title'' page" do |title| > browser.wait_until_includes(title) > end > > Given "the user is at ''$title'' page" do |title| > browser.wait_until_includes(title) > end > > > I think these *are* both valid ''Whens'' and ''Thens'', but I am getting a > duplicate error from Cucumber.I see a Given and a Then. Can you clarify?> > Any opinions or suggestions please? > > Aidy
aslak hellesoy
2008-Sep-23 16:32 UTC
[rspec-users] Story Runner => Cucumber(duplicate steps)!
On Tue, Sep 23, 2008 at 6:18 PM, aidy lewis <aidy.lewis at googlemail.com> wrote:> Hi, > > I am currently moving over my Watir Story Runner tests over to Cucumber. > > However, I have a verification_steps.rb that holds these two steps > > Then "the user is at ''$title'' page" do |title| > browser.wait_until_includes(title) > end > > Given "the user is at ''$title'' page" do |title| > browser.wait_until_includes(title) > end > > > I think these *are* both valid ''Whens'' and ''Thens'', but I am getting a > duplicate error from Cucumber. > > Any opinions or suggestions please? >Cucumber doesn''t distinguish between Given/When/Then. Just delete one of them. On a more semantic note - I usually recommend that: * Given and When steps be expressed (grammatically) as non-negotiable facts * Then steps be expressed (grammatically) as expectations ("should be at the home page") http://www.englishpage.com/modals/should.html "Then" steps represent the outputs of your system, which is often related to the feature''s *business value*. What you get out of a system and it''s behaviour is not a fact, it''s an expectation ;-) Aslak> Aidy > > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >