Cucumber can't find Webrat steps

145 views
Skip to first unread message

steven_noble

unread,
Jan 30, 2011, 7:46:15 AM1/30/11
to web...@googlegroups.com
I've previously happily used Webrat under Rails 2.x, but under Rails 3.x whenever I call a Webrat method in a Cucumber step definition I get the following error:

undefined method name_of_webrat_method for #<Cucumber::Rails::World:XXXXXXXXXX> (NoMethodError)

I have run sudo gem install webrat and bundle install.

My Gemfile contains:

group :test, :cucumber do
gem 'syntax' gem 'mongrel' gem 'rspec-rails' gem 'capybara' gem 'cucumber' gem 'cucumber-rails' gem 'database_cleaner' gem 'hydra' gem 'launchy' # So you can do Then show me the page gem 'spork' gem 'sqlite3-ruby', :require => 'sqlite3' gem 'webrat' end

My features/support/env.rb contains:

  require 'webrat'
  require 'webrat/core/matchers'
  
  Webrat.configure do |config|
    config.mode = :rails
    config.open_error_files = false # Set to true if you want error pages to pop up in the browser
  end

Any ideas?

Many thanks,

Steven.


Daniel Dyba

unread,
Jun 11, 2011, 5:08:07 PM6/11/11
to web...@googlegroups.com
What versions of each gem are you using? You'll run into trouble later on if you don't specifically mention the versions of your gems in your Gemfile (i.e. incompatibility between gems). You need to show the entire files (i.e. env.rb, Gemfile, and your cucumber step definition file) so I get a better picture. A backtrace would be helpful also when you run the cucumber command. 
Reply all
Reply to author
Forward
0 new messages