Skip to content

Instantly share code, notes, and snippets.

@diabolo
Created May 15, 2009 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save diabolo/112149 to your computer and use it in GitHub Desktop.
Save diabolo/112149 to your computer and use it in GitHub Desktop.
require 'cucumber/rake/task'
namespace :cucumber do
Cucumber::Rake::Task.new(:webrat) do |t|
t.fork = true # Explicitly fork for cucumber 0.3.4 and rails
t.cucumber_opts = "--format progress"
t.step_list = %w{features/support/env.rb features/support/webrat.rb features/step_definitions}
t.feature_list = %w{features/webrat}
end
task :webrat => 'db:test:prepare'
end
desc "shortcut for cucumber:webrat"
task :features => 'cucumber:webrat'
namespace :features do
Cucumber::Rake::Task.new(:rcov, "Run Cucumber features with RCov") do |t|
t.fork = true # Explicitly fork for cucumber 0.3.4 and rails
t.cucumber_opts = '--format pretty'
t.step_list = %w{features/support/env.rb features/support/webrat.rb features/step_definitions}
t.feature_list = %w{features/webrat}
t.rcov = true
t.rcov_opts << '-o coverage'
t.rcov_opts << '--text-report'
t.rcov_opts << '--exclude features\/,spec\/'
t.rcov_opts << '--sort coverage'
end
task :rcov => 'db:test:prepare'
namespace :rcov do
Cucumber::Rake::Task.new(:redundant, "Search for unused step definitions using RCov") do |t|
t.fork = true # Explicitly fork for cucumber 0.3.4 and rails
t.cucumber_opts = '--format pretty'
t.step_list = %w{features/support/env.rb features/support/webrat.rb features/step_definitions}
t.feature_list = %w{features/webrat}
t.rcov = true
t.rcov_opts << '-o coverage'
t.rcov_opts << '--text-report'
t.rcov_opts << '--exclude spec\/'
t.rcov_opts << '--sort coverage'
end
task :redundant => 'db:test:prepare'
end
end
rake cucumber:webrat
(in /Users/andy/Sites/mvor)
/opt/local/bin/ruby -I "/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.5/lib:lib" "/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.5/bin/cucumber" --format progress features/webrat
UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU----UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU---UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU----UUUUUUUU-----UUUUUUUU----UUUUUUUU------UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU---UUUUUUUUUUUUUU-----UUUUUUUUUUUUUU-------UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU-----UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
135 scenarios (135 undefined)
855 steps (855 undefined)
You can implement step definitions for undefined steps with these snippets:
Given /^I am a registered user$/ do
pending
end
When /^I activate myself$/ do
pending
end
rake cucumber:webrat --trace
(in /Users/andy/Sites/mvor)
** Invoke cucumber:webrat (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
** Execute cucumber:webrat
rake aborted!
undefined method `differ=' for Spec::Expectations:Module
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.5/lib/cucumber/cli/main.rb:99:in `enable_diffing'
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.5/lib/cucumber/cli/main.rb:35:in `execute!'
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.5/lib/cucumber/cli/main.rb:20:in `execute'
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.5/lib/cucumber/rake/task.rb:41:in `run'
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.5/lib/cucumber/rake/task.rb:169:in `define_task'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:636:in `call'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:636:in `execute'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:631:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:631:in `execute'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:597:in `invoke_with_call_chain'
/opt/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:583:in `invoke'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:2047:in `invoke_task'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:2025:in `top_level'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:2025:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:2025:in `top_level'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:2064:in `standard_exception_handling'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:2019:in `top_level'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:1997:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:2064:in `standard_exception_handling'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/lib/rake.rb:1994:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.5/bin/rake:31
/opt/local/bin/rake:19:in `load'
/opt/local/bin/rake:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment