From 6f3579a63e109f6a78d54bc58625f301644006e0 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Fri, 2 Nov 2012 19:14:03 -0700 Subject: [PATCH] Make database a file task. Now it will only do the migration if we need to. --- Rakefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Rakefile b/Rakefile index 19047ff..1eb05a6 100644 --- a/Rakefile +++ b/Rakefile @@ -9,14 +9,12 @@ RSpec::Core::RakeTask.new require 'cucumber/rake/task' Cucumber::Rake::Task.new -namespace :db do - desc 'Prepare sqlite database' - task :migrate do - system 'cd spec/dummy && rake db:migrate RAILS_ENV=test && rake db:migrate RAILS_ENV=development' - end +file "spec/dummy/db/test.sqlite3" do + system "cd spec/dummy && + RAILS_ENV=test rake db:migrate" end -task :cucumber => :"db:migrate" +task :cucumber => :"spec/dummy/db/test.sqlite3" desc "Run all tests for CI" task "ci" => ["spec", "cucumber"]