Hack the rake tasks to run cucumber + rspec

This commit is contained in:
Stephen Caudill 2010-09-25 21:29:42 -04:00
parent 5f2d4ba073
commit 3e499c0f1b
3 changed files with 7 additions and 7 deletions

View file

@ -10,4 +10,5 @@
require File.expand_path('../config/application', __FILE__) require File.expand_path('../config/application', __FILE__)
require 'rake' require 'rake'
ENV['GNUPGHOME'] = File.expand_path("../../gpg/diaspora-#{Rails.env}/", __FILE__) ENV['GNUPGHOME'] = File.expand_path("../../gpg/diaspora-#{Rails.env}/", __FILE__)
Diaspora::Application.load_tasks Diaspora::Application.load_tasks

View file

@ -14,19 +14,19 @@ begin
require 'cucumber/rake/task' require 'cucumber/rake/task'
namespace :cucumber do namespace :cucumber do
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t| Cucumber::Rake::Task.new(:ok, 'Run features that should pass') do |t|
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
t.fork = true # You may get faster startup if you set this to false t.fork = true # You may get faster startup if you set this to false
t.profile = 'default' t.profile = 'default'
end end
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t| Cucumber::Rake::Task.new(:wip, 'Run features that are being worked on') do |t|
t.binary = vendored_cucumber_bin t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false t.fork = true # You may get faster startup if you set this to false
t.profile = 'wip' t.profile = 'wip'
end end
Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t| Cucumber::Rake::Task.new(:rerun, 'Record failing features and run only them if any exist') do |t|
t.binary = vendored_cucumber_bin t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false t.fork = true # You may get faster startup if you set this to false
t.profile = 'rerun' t.profile = 'rerun'
@ -38,7 +38,9 @@ begin
desc 'Alias for cucumber:ok' desc 'Alias for cucumber:ok'
task :cucumber => 'cucumber:ok' task :cucumber => 'cucumber:ok'
task :default => :cucumber Rake.application.instance_variable_get('@tasks').delete('default')
task :default => [:cucumber, :spec]
task :features => :cucumber do task :features => :cucumber do
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"

View file

@ -32,13 +32,10 @@ MSG
end end
end end
Rake.application.instance_variable_get('@tasks').delete('default')
spec_prereq = Rails.root.join('config', 'database.yml').exist? ? "db:test:prepare" : :noop spec_prereq = Rails.root.join('config', 'database.yml').exist? ? "db:test:prepare" : :noop
task :noop do task :noop do
end end
task :default => :spec
task :stats => "spec:statsetup" task :stats => "spec:statsetup"
desc "Run all specs in spec directory (excluding plugin specs)" desc "Run all specs in spec directory (excluding plugin specs)"