English 中文(简体)
Rails 3, RSpec 2, and Cucumber yields wrong number of arguments (3 for 1) (ArgumentError)
原标题:

I mostly followed these instructions to get things spun up: http://lindsaar.net/2010/5/9/Getting-Rails-3-Edge-with-jQuery-RSpec-and-Cucumber-using-RVM

If I create a completely blank .feature file, running cucumber results in this error:

cucumber

wrong number of arguments (3 for 1) (ArgumentError) /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:125:in scan /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:125:in transition_table /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:112:in build_transition_map /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:108:in transition_map /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:75:in initialize /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:52:innew /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:52:in push_machine /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:20:ininitialize /gems/cucumber-0.8.3/bin/../lib/cucumber/feature_file.rb:32:in new /gems/cucumber-0.8.3/bin/../lib/cucumber/feature_file.rb:32:in parse /gems/cucumber-0.8.3/bin/../lib/cucumber/step_mother.rb:62:in load_plain_text_features /gems/cucumber-0.8.3/bin/../lib/cucumber/step_mother.rb:60:in each /gems/cucumber-0.8.3/bin/../lib/cucumber/step_mother.rb:60:in load_plain_text_features /gems/cucumber-0.8.3/bin/../lib/cucumber/cli/main.rb:55:in execute! /gems/cucumber-0.8.3/bin/../lib/cucumber/cli/main.rb:25:in execute /gems/cucumber-0.8.3/bin/cucumber:8 /bin/cucumber:19:inload /bin/cucumber:19

Interestingly, if I comment out the features/support/env.rb file, I do not get the error. That doesn t do me much good though. I can run the site successfully (It s empty). Can anyone think of why the env code would kill the gherkin parser? I m a little too new at this to know where to look next.

Thanks. -Jeff

最佳回答

Has this one answered for me. It s an incompatibility between the latest cucumber and gherkin. Needed to alter my gemfile to:

gem "cucumber" gem "gherkin", "= 2.1.4" gem "cucumber-rails"

问题回答

暂无回答




相关问题
How to use rspec to test named routes?

Given I have a named route: map.some_route /some_routes/:id , :controller => some , :action => other How do I use the routing spec file spec/routing/some_routing_spec.rb to test for that ...

Silencing Factory Girl logging

Just to clear the air, I am not some cruel factory master trying to silence working ladies. I am having a very annoying problem where when using Thoughtbot s factory girl in my specs, every time ...

Controller specs in isolation mode and render :update

I am using RSpec for writing my controller tests/specs. I faced the problem, that the following code gets rendered: render :update do |page| page[ middle_content ].replace_html :partial => "...

rspec testing views with internationalization?

I want to make sure I have the right meta desc/keyword and title text in my view so I want to create rspec views tests for that. Now the real challange here is how to make it work across multiple ...

热门标签