From 2f2abda054a731adb025c5e8a4a853a6ef3de550 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Tue, 2 Aug 2011 23:33:57 -0300 Subject: [PATCH] Set up test db when running rake --- Gemfile.lock | 6 +++--- Rakefile | 4 ++++ test/dummy/Gemfile.lock | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ae1f38d1..033d6a9d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: exception_notification (2.4.1) - actionmailer (~> 3.0.9) + actionmailer (>= 3.0.4) GEM remote: http://rubygems.org/ @@ -79,5 +79,5 @@ PLATFORMS DEPENDENCIES exception_notification! - rails (~> 3.0.9) - sqlite3 (~> 1.3.4) + rails (>= 3.0.4) + sqlite3 (>= 1.3.4) diff --git a/Rakefile b/Rakefile index b2c19f61..5fbb69f5 100644 --- a/Rakefile +++ b/Rakefile @@ -3,6 +3,10 @@ Bundler::GemHelper.install_tasks require 'rake/testtask' +unless File.exists? "test/dummy/db/test.sqlite3" + sh "cd test/dummy; rake db:migrate; rake db:test:prepare; cd ../../;" +end + Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test' diff --git a/test/dummy/Gemfile.lock b/test/dummy/Gemfile.lock index 1358756f..63e9badb 100644 --- a/test/dummy/Gemfile.lock +++ b/test/dummy/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: ../../.. specs: exception_notification (2.4.1) - actionmailer (~> 3.0.9) + actionmailer (>= 3.0.4) GEM remote: http://rubygems.org/