Rails 3、RSpec 2 和 Cucumber 产生错误数量的参数(1 为 3)(ArgumentError)
我主要遵循以下说明来让事情运转起来: http: //lindsaar.net/2010/5/9/Getting-Rails-3-Edge-with-jQuery-RSpec-and-Cucumber-using-RVM
如果我创建一个完全空白的 .feature 文件,运行 Cucumber 结果在这个错误中:
黄瓜
参数数量错误(1 为 3) (参数错误) /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:125:in <代码>扫描' /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初始化' /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:52:in
新' /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:52:inpush_machine' /gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:20:in
初始化' /gems/cucumber-0.8.3/bin/../lib/cucumber/feature_file.rb:32:in <代码>新' /gems/cucumber-0.8.3/bin/../lib/cucumber/feature_file.rb:32:in 解析' /gems/cucumber-0.8.3/bin/../lib/cucumber/step_mother.rb:62:inload_plain_text_features' /gems/cucumber-0.8.3/bin/../lib/cucumber/step_mother.rb:60:in
每个' /gems/cucumber-0.8.3/bin/../lib/cucumber/step_mother.rb:60:inload_plain_text_features' /gems/cucumber-0.8.3/bin/../lib/cucumber/cli/main.rb:55:in 执行!' /gems/cucumber-0.8.3/bin/../lib/cucumber/cli/main.rb:25:in <代码>执行' /gems/黄瓜-0.8.3/bin/黄瓜:8 /bin/cucumber:19:in
加载' /bin/黄瓜:19
有趣的是,如果我注释掉 features/support/env.rb 文件,我不会收到错误。但这对我没有多大好处。我可以成功运行该网站(它是空的)。谁能想到为什么环境代码会杀死小黄瓜解析器?我对此有点陌生,不知道下一步该往哪里看。
谢谢。 -杰夫
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:inscan'
transition_table'
/gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:125:in
/gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:112:inbuild_transition_map'
transition_map'
/gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:108:in
/gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:75:ininitialize'
new'
/gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:52:in
/gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:52:inpush_machine'
initialize'
/gems/gherkin-2.0.2/lib/gherkin/parser/parser.rb:20:in
/gems/cucumber-0.8.3/bin/../lib/cucumber/feature_file.rb:32:innew'
parse'
/gems/cucumber-0.8.3/bin/../lib/cucumber/feature_file.rb:32:in
/gems/cucumber-0.8.3/bin/../lib/cucumber/step_mother.rb:62:inload_plain_text_features'
each'
/gems/cucumber-0.8.3/bin/../lib/cucumber/step_mother.rb:60:in
/gems/cucumber-0.8.3/bin/../lib/cucumber/step_mother.rb:60:inload_plain_text_features'
execute!'
/gems/cucumber-0.8.3/bin/../lib/cucumber/cli/main.rb:55:in
/gems/cucumber-0.8.3/bin/../lib/cucumber/cli/main.rb:25:inexecute'
load'
/gems/cucumber-0.8.3/bin/cucumber:8
/bin/cucumber:19:in
/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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这位有没有帮我解答一下。这是最新的黄瓜和小黄瓜之间的不相容。需要将我的 gemfile 更改为:
gem“cucumber”
宝石“小黄瓜”,“= 2.1.4”
宝石“黄瓜导轨”
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"