views:

150

answers:

0

I'm tearing my hair out here. When running Cucumber in Spork-compatible mode (--drb) the visit() method doesn't work.

Simply trying the feature step:

When I go to the home page

calls web step:

When /^(?:|I )go to (.+)$/ do |page_name|
  visit path_to(page_name)
end

Running "cucumber" on the command line produces the following error:

% 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

Does anyone have an idea why visit() would not be available?


My environment:

I'm using Rails 2.3.9 and just installed cucumber-rails (0.3.2), cucumber (0.9.2), capybara (0.3.9), and spork (0.8.4). What's interesting is if I don't use Spork then this works absolutely fine:

% cucumber
Using the default profile...
...

1 scenario (1 passed)
3 steps (3 passed)
0m0.114s

Another intersting data point:

I did a little debugging and deep within the Cucumber gem itself (inside cucumber-0.9.2/lib/cucumber/core_ext/instance_exec.rb) I put in a puts() to dump out what self.class.name was to stdout, and when I ran with Spork it spit out "Object" but when I ran it without Spork it printed "Cucumber::Rails::World".