Ruby on rails 黄瓜+;Spork=未定义的方法“访问';对于#<;对象:0x82fcc588>;(命名错误)?
我在这儿把头发扯下来。在Spork兼容模式(-drb)下运行Cucumber时,visit()方法不起作用 只需尝试功能步骤:Ruby on rails 黄瓜+;Spork=未定义的方法“访问';对于#<;对象:0x82fcc588>;(命名错误)?,ruby-on-rails,cucumber,bdd,capybara,spork,Ruby On Rails,Cucumber,Bdd,Capybara,Spork,我在这儿把头发扯下来。在Spork兼容模式(-drb)下运行Cucumber时,visit()方法不起作用 只需尝试功能步骤: When I go to the home page 调用web步骤: When /^(?:|I )go to (.+)$/ do |page_name| visit path_to(page_name) end 在命令行上运行“cumber”会产生以下错误: % cucumber Using the default profile... Disabling p
When I go to the home page
调用web步骤:
When /^(?:|I )go to (.+)$/ do |page_name|
visit path_to(page_name)
end
在命令行上运行“cumber”会产生以下错误:
% cucumber
Using the default profile...
Disabling profiles...
.F--
(::) failed steps (::)
undefined method `visit' for #<Object:0x82fcc588> (NoMethodError)
./features/step_definitions/web_steps.rb:24:in `/^(?:|I )go to (.+)$/'
features/authenticated/home_page_visit.feature:10:in `When I go to the home page'
Failing Scenarios:
cucumber features/authenticated/home_page_visit.feature:7 # Scenario: Visit the home page
另一个有趣的数据点:
我做了一些调试,深入到Cucumber gem本身(在Cucumber-0.9.2/lib/Cucumber/core\u ext/instance\u exec.rb中),我输入了一个put()来转储stdout中self.class.name的内容,当我使用Spork运行时,它会吐出“Object”,但当我不使用Spork运行时,它会打印“cumber::Rails::World”.我是在github上打开的,我可以确认它对cucumber 0.9.3及更高版本有效。我是在github上打开的,我可以确认它对cucumber 0.9.3及更高版本有效。我最近升级到cucumber 0.9,开始收到类似您的错误,并切换回cucumber 0.8.5Hm。我会试着降级。上的注释给出了cucumber的代码修复,但它尚未集成到cucumber的主分支中。寻找cucumber的未来版本来修复它(0.9.3?)。我最近升级到cucumber 0.9,开始收到类似于您的错误,并切换回cucumber 0.8.5Hm。我会试着降级。上的注释给出了cucumber的代码修复,但它尚未集成到cucumber的主分支中。寻找cucumber的未来版本来修复它(0.9.3?)。
% cucumber
Using the default profile...
...
1 scenario (1 passed)
3 steps (3 passed)
0m0.114s