[rspec-users] Cucumber rake/webrat issue.

Matthew Van Horn mattvanhorn at gmail.com
Mon May 18 14:49:17 EDT 2009

I'm probably missing something really obvious, but I just upgraded  
cucumber, rspec/rails, and webrat on a project, and for some reason,  
cucumber is not seeing any of the webrat steps (or bmabey's email  
steps) when running from rake.  It seems ok when running using the  
cucumber binary.

The versions are (most recent of the following):
bmabey-email_spec (0.1.3)
cucumber (0.3.5, 0.3.2, 0.3.0)
rspec (1.2.6, 1.2.4)
rspec-rails (1.2.6, 1.2.4)
webrat (0.4.4)

My env.rb looks like this:

# Sets up the Rails environment for Cucumber
ENV["RAILS_ENV"] ||= "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/ 
require 'cucumber/rails/world'
require 'email_spec/cucumber'

require 'cucumber/formatter/unicode' # Comment out this line if you  
don't want Cucumber Unicode support
Cucumber::Rails.bypass_rescue # Comment out this line if you want  
Rails own error handling
                               # (e.g. rescue_action_in_public /  
rescue_responses / rescue_from)

require 'webrat'

Webrat.configure do |config|
   config.mode = :rails

require 'cucumber/rails/rspec'
require 'webrat/core/matchers'

Lib tasks cucumber.rake looks like:
$LOAD_PATH.unshift(RAILS_ROOT + '/vendor/plugins/cucumber/lib') if  
File.directory?(RAILS_ROOT + '/vendor/plugins/cucumber/lib')

   require 'cucumber/rake/task'

   Cucumber::Rake::Task.new(:features) do |t|
     t.fork = true
     t.cucumber_opts = %w{--format pretty}
   task :features => 'db:test:prepare'
rescue LoadError
   desc 'Cucumber rake task not available'
   task :features do
     abort 'Cucumber rake task is not available. Be sure to install  
cucumber as a gem or plugin'

More information about the rspec-users mailing list