Hi everyone I am trying to run the CS examples using Iron ruby/ cucumber from the download and have hit a really irritating snag I have added a subtract method to the CS calculator - Re compiled - Added a features file for it and when I run I get the following Scenario: subtract two numbers # features/subtraction.feature: 6 Given I have entered 70 into the calculator And I have entered 50 into the calculator When I press subtract Then the result should be 20 on the screen And the result class should be Fixnum |input_1|input_2|button |output|class | |30 |20 |subtract|10 | expected: 0, got: 10 (using ==) Diff: @@ -1,2 +1,2 @@ -0 +10 (Spec::Expectations::ExpectationNotMetError) features/subtraction.feature:15:in `/the result should be (.*) on the scre en/'' As you can see the calculator returns the right number (10) but somehow the features file is expecting 0??? Even though I have defined 10 as the result? Can anyone help me - I''m doing my head in Below is the subtract method from the steps file and the result compare When /I press subtract/ do @result = @calc.Subtract end Then /the result should be (.*) on the screen/ do |result| @result.should == result.to_i end Malcolm Beaton _______________ EMC Consulting Phone: +44 1784 222127 | Mobile: +44 7768 427309 malcolm.beaton at emc.com <mailto:last_firstname at emc.com> www.emc.com/consulting <http://www.emc.com/consulting> ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090212/1b1a3077/attachment-0001.html>
Those features look out of date to me. The Scenarios / More Examples format has been deprecated in the latest version on Github. Which version of cucumber are you using? Try this instead: http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines On 12 Feb 2009, at 12:01, Beaton, Malcolm wrote:> > > Hi everyone > > I am trying to run the CS examples using Iron ruby/ cucumber from > the download and have hit a really irritating snag > > I have added a subtract method to the CS calculator ? Re compiled ? > Added a features file for it and when I run I get the following > > Scenario: subtract two numbers # features/ > subtraction.feature: > 6 > Given I have entered 70 into the calculator > And I have entered 50 into the calculator > When I press subtract > Then the result should be 20 on the screen > And the result class should be Fixnum > > |input_1|input_2|button |output|class | > |30 |20 |subtract|10 | > > expected: 0, > got: 10 (using ==) > Diff: > @@ -1,2 +1,2 @@ > -0 > +10 (Spec::Expectations::ExpectationNotMetError) > features/subtraction.feature:15:in `/the result should be (.*) > on the scre > en/'' > > As you can see the calculator returns the right number (10) but > somehow the features file is expecting 0??? Even though I have > defined 10 as the result? > Can anyone help me ? I?m doing my head in > Below is the subtract method from the steps file and the result > compare > > When /I press subtract/ do > @result = @calc.Subtract > end > > Then /the result should be (.*) on the screen/ do |result| > @result.should == result.to_i > end > > > > > Malcolm Beaton > _______________ > EMC Consulting > Phone: +44 1784 222127 | Mobile: +44 7768 427309 > malcolm.beaton at emc.com > www.emc.com/consulting > > > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit http://www.messagelabs.com/email > ______________________________________________________________________ > _______________________________________________ > 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
I installed it via the Gem package manager ? The version I have installed is cucumber-0.1.16 <went away and changed things> And I have just re written the features file as suggested in the link and it works Weird that the addition in the examples works even though it is in the older format?? Thanks Heaps - I can now keep what little hair I have left Mal -----Original Message----- From: rspec-users-bounces at rubyforge.org [mailto:rspec-users-bounces at rubyforge.org] On Behalf Of Matt Wynne Sent: 12 February 2009 14:39 To: rspec-users Subject: Re: [rspec-users] Sorry if this is a stupid question Those features look out of date to me. The Scenarios / More Examples format has been deprecated in the latest version on Github. Which version of cucumber are you using? Try this instead: http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines On 12 Feb 2009, at 12:01, Beaton, Malcolm wrote:> > > Hi everyone > > I am trying to run the CS examples using Iron ruby/ cucumber from > the download and have hit a really irritating snag > > I have added a subtract method to the CS calculator - Re compiled - > Added a features file for it and when I run I get the following > > Scenario: subtract two numbers # features/ > subtraction.feature: > 6 > Given I have entered 70 into the calculator > And I have entered 50 into the calculator > When I press subtract > Then the result should be 20 on the screen > And the result class should be Fixnum > > |input_1|input_2|button |output|class | > |30 |20 |subtract|10 | > > expected: 0, > got: 10 (using ==) > Diff: > @@ -1,2 +1,2 @@ > -0 > +10 (Spec::Expectations::ExpectationNotMetError) > features/subtraction.feature:15:in `/the result should be (.*) > on the scre > en/'' > > As you can see the calculator returns the right number (10) but > somehow the features file is expecting 0??? Even though I have > defined 10 as the result? > Can anyone help me - I''m doing my head in > Below is the subtract method from the steps file and the result > compare > > When /I press subtract/ do > @result = @calc.Subtract > end > > Then /the result should be (.*) on the screen/ do |result| > @result.should == result.to_i > end > > > > > Malcolm Beaton > _______________ > EMC Consulting > Phone: +44 1784 222127 | Mobile: +44 7768 427309 > malcolm.beaton at emc.com > www.emc.com/consulting > > > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit http://www.messagelabs.com/email > ______________________________________________________________________ > _______________________________________________ > 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 _______________________________________________ rspec-users mailing list rspec-users at rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________