ここで髪をかきむしっています。Cucumber を Spork 互換モード (--drb) で実行すると、visit()メソッドが機能しません。
機能ステップを試すだけです:
When I go to the home page
Web ステップを呼び出します:
When /^(?:|I )go to (.+)$/ do |page_name|
visit path_to(page_name)
end
コマンド ラインで「cucumber」を実行すると、次のエラーが発生します。
% 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
visit() が利用できない理由を知っている人はいますか?
私の環境:
Rails 2.3.9 を使用しており、cucumber-rails (0.3.2)、cucumber (0.9.2)、capybara (0.3.9)、および spork (0.8.4) をインストールしました。興味深いのは、Spork を使用しない場合、これはまったく問題なく動作することです。
% cucumber
Using the default profile...
...
1 scenario (1 passed)
3 steps (3 passed)
0m0.114s
別の興味深いデータ ポイント:
少しデバッグを行い、Cucumber gem 自体 (cucumber-0.9.2/lib/cucumber/core_ext/instance_exec.rb 内) の奥深くで、puts()を入れて、 self.class.nameをstdoutにダンプしました。 Spork を使用して実行すると「Object」が吐き出されましたが、Spork を使用せずに実行すると「Cucumber::Rails::World」と出力されました。