Zhenning Guan
2009-May-17 05:56 UTC
[rspec-users] what''s wrong with my newbie cucumber test?
forums.feature Feature: Tasks In order to keep track of tasks People should be able to Create a list of tasks Scenario: List Tasks When I go to the homepage forums_steps.rb When /^I go to the homepage$/ do visit "/forums" end when I run rake features. =Scenario: List Tasks # features/forums.feature:6 When I go to the homepage # features/forums.feature:7 Ambiguous match of "I go to the homepage": features/step_definitions/webrat_steps.rb:10:in `/^I go to (.+)$/'' features/step_definitions/forums_steps.rb:1:in `/^I go to the homepage$/'' You can run again with --guess to make Cucumber be more smart about it (Cucumber::Ambiguous) /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/step_mother.rb:210:in `step_match'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_invocation.rb:50:in `find_step_match!'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_invocation.rb:27:in `invoke'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_invocation.rb:22:in `accept'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/visitor.rb:74:in `visit_step'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/formatter/pretty.rb:124:in `visit_step'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_collection.rb:14:in `accept'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_collection.rb:13:in `each'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_collection.rb:13:in `accept'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/visitor.rb:70:in `visit_steps'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/scenario.rb:29:in `accept'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/step_mother.rb:236:in `before_and_after'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/scenario.rb:28:in `accept'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/visitor.rb:45:in `visit_feature_element'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/formatter/pretty.rb:79:in `visit_feature_element'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/feature.rb:23:in `accept'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/feature.rb:22:in `each'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/feature.rb:22:in `accept'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/visitor.rb:23:in `visit_feature'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/formatter/pretty.rb:41:in `visit_feature'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/features.rb:21:in `accept'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/features.rb:20:in `each'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/features.rb:20:in `accept'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/visitor.rb:19:in `visit_features'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/formatter/pretty.rb:26:in `visit_features'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/broadcaster.rb:9:in `__send__'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/broadcaster.rb:9:in `method_missing'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/broadcaster.rb:8:in `map'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/broadcaster.rb:8:in `method_missing'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/cli/main.rb:41:in `execute!'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/cli/main.rb:20:in `execute'' /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/cucumber:6 features/forums.feature:7:in `When I go to the homepage'' 1 scenario (1 failed) 1 step (1 failed) rake aborted! Command failed with status (1): [/usr/bin/ruby -I "/home/ning/.gem/ruby/1.8...] =does anyone can tell me what''s wrong with my test? -- Posted via http://www.ruby-forum.com/.
James Byrne
2009-May-17 15:51 UTC
[rspec-users] what''s wrong with my newbie cucumber test?
Zhenning Guan wrote:> > when I run rake features. > => Scenario: List Tasks # features/forums.feature:6 > When I go to the homepage # features/forums.feature:7 > Ambiguous match of "I go to the homepage": > > features/step_definitions/webrat_steps.rb:10:in `/^I go to (.+)$/'' > features/step_definitions/forums_steps.rb:1:in `/^I go to the > homepage$/'' > > You can run again with --guess to make Cucumber be more smart > about it > (Cucumber::Ambiguous) > > does anyone can tell me what''s wrong with my test?You have duplicate step matchers, one in webrat_steps.rb at line 10 and the other in forums_steps at line 1. The regexp /^I go to (.+)$/ matches the same thing as /^I go to the homepage$/. Change them so as to be more specific. /^ I go to the forum (.+)$/ and /^I go to the user homepage$/ Personally, I drop the leading pronoun together with the start/end of line symbols as well. /\bgo to the user homepage\b/ -- Posted via http://www.ruby-forum.com/.
mithunperera
2009-Oct-02 00:27 UTC
[rspec-users] what''s wrong with my newbie cucumber test?
hi, I did a senario like to u. but i got unswer. go and follow http://jeewanthajtk.blogspot.com cheers, mithun :super::handshake: Mithun Perera wrote:> > forums.feature > > Feature: Tasks > In order to keep track of tasks > People should be able to > Create a list of tasks > > Scenario: List Tasks > When I go to the homepage > > > forums_steps.rb > > When /^I go to the homepage$/ do > visit "/forums" > end > > > when I run rake features. > => Scenario: List Tasks # features/forums.feature:6 > When I go to the homepage # features/forums.feature:7 > Ambiguous match of "I go to the homepage": > > features/step_definitions/webrat_steps.rb:10:in `/^I go to (.+)$/'' > features/step_definitions/forums_steps.rb:1:in `/^I go to the > homepage$/'' > > You can run again with --guess to make Cucumber be more smart > about it > (Cucumber::Ambiguous) > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/step_mother.rb:210:in > `step_match'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_invocation.rb:50:in > `find_step_match!'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_invocation.rb:27:in > `invoke'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_invocation.rb:22:in > `accept'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/visitor.rb:74:in > `visit_step'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/formatter/pretty.rb:124:in > `visit_step'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_collection.rb:14:in > `accept'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_collection.rb:13:in > `each'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/step_collection.rb:13:in > `accept'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/visitor.rb:70:in > `visit_steps'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/scenario.rb:29:in > `accept'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/step_mother.rb:236:in > `before_and_after'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/scenario.rb:28:in > `accept'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/visitor.rb:45:in > `visit_feature_element'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/formatter/pretty.rb:79:in > `visit_feature_element'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/feature.rb:23:in > `accept'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/feature.rb:22:in > `each'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/feature.rb:22:in > `accept'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/visitor.rb:23:in > `visit_feature'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/formatter/pretty.rb:41:in > `visit_feature'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/features.rb:21:in > `accept'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/features.rb:20:in > `each'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/features.rb:20:in > `accept'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/ast/visitor.rb:19:in > `visit_features'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/formatter/pretty.rb:26:in > `visit_features'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/broadcaster.rb:9:in > `__send__'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/broadcaster.rb:9:in > `method_missing'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/broadcaster.rb:8:in > `map'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/broadcaster.rb:8:in > `method_missing'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/cli/main.rb:41:in > `execute!'' > > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/../lib/cucumber/cli/main.rb:20:in > `execute'' > /home/ning/.gem/ruby/1.8/gems/cucumber-0.3.3/bin/cucumber:6 > features/forums.feature:7:in `When I go to the homepage'' > > 1 scenario (1 failed) > 1 step (1 failed) > rake aborted! > Command failed with status (1): [/usr/bin/ruby -I > "/home/ning/.gem/ruby/1.8...] > > > > > => does anyone can tell me what''s wrong with my test? > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > 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/what%27s-wrong-with-my-newbie-cucumber-test--tp23580449p25708812.html Sent from the rspec-users mailing list archive at Nabble.com.
Stephen Eley
2009-Oct-02 13:48 UTC
[rspec-users] what''s wrong with my newbie cucumber test?
On Fri, Oct 2, 2009 at 9:24 AM, Tim Walker <walketim at gmail.com> wrote:> Try commenting out your step completely or temporarily removing > forums_step.rb. Run and see what step it''s matching. I''d imagine it''s > matching a webrat step.Also: there''s a separate list for Cucumber stuff these days. Check out: http://groups.google.com/group/cukes -- Have Fun, Steve Eley (sfeley at gmail.com) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepod.org