Skip to content

Instantly share code, notes, and snippets.

@kristopher
Created June 29, 2010 22:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristopher/457901 to your computer and use it in GitHub Desktop.
Save kristopher/457901 to your computer and use it in GitHub Desktop.
begin
require 'cucumber/rake/task'
namespace :cucumber do
Cucumber::Rake::Task.new(:ci, 'Run features for ci') do |t|
t.fork = true # You may get faster startup if you set this to false
t.cucumber_opts = "--color --tags ~@wip,~@local --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
end
end
desc "Runs specs and features for ci"
task :build => 'db:migrate:reset' do
build_error = nil
begin
Rake::Task['spec'].invoke
rescue SystemExit => e
build_error = e
ensure
Rake::Task['cucumber:ci'].invoke
end
if build_error
raise e
end
end
rescue LoadError
desc 'cucumber rake task not available (cucumber not installed)'
task :cucumber do
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
end
task :build do
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
end
end
Rake::Task[:default].clear
task :default => :build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment