Skip to content

Instantly share code, notes, and snippets.

@jstirk
Created October 2, 2009 03:04
Show Gist options
  • Save jstirk/199432 to your computer and use it in GitHub Desktop.
Save jstirk/199432 to your computer and use it in GitHub Desktop.
cucumber.rake inc. CC.rb task
$LOAD_PATH.unshift(RAILS_ROOT + '/vendor/plugins/cucumber/lib') if File.directory?(RAILS_ROOT + '/vendor/plugins/cucumber/lib')
begin
require 'cucumber/rake/task'
task :features => 'db:test:prepare'
desc "Run all features"
task :features => "features:all"
namespace :features do
Cucumber::Rake::Task.new(:all) do |t|
t.cucumber_opts = "--format pretty"
end
Cucumber::Rake::Task.new(:cruise) do |t|
t.cucumber_opts = "--format pretty --out=#{ENV['CC_BUILD_ARTIFACTS']}/features.txt --format html --out=#{ENV['CC_BUILD_ARTIFACTS']}/features.html"
t.rcov = true
t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/,lib\/,features\/}
t.rcov_opts << %[-o "#{ENV['CC_BUILD_ARTIFACTS']}/features_rcov"]
end
Cucumber::Rake::Task.new(:rcov) do |t|
t.rcov = true
t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/,lib\/,features\/}
t.rcov_opts << %[-o "features_rcov"]
end
end
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'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment