From b017c5124020095335677e53e8b0045b3181485c Mon Sep 17 00:00:00 2001 From: elliottcable Date: Fri, 11 Apr 2008 05:26:56 -0800 Subject: [PATCH] Fixed up the rakefile so integration tests would pass, and added a task to ensure correct setup --- Rakefile.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Rakefile.rb b/Rakefile.rb index f69b730..3b0a9e4 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -24,6 +24,11 @@ Merb.start_environment(:environment => init_env, :adapter => 'runner') end +task :check_config do + raise 'You need to copy config/database.yml.sample to config/database.yml, and add your data!' unless + File.file? 'config/database.yml' +end + # Runs specs, generates rcov, and opens rcov in your browser. namespace :rcov do Spec::Rake::SpecTask.new(:run) do |t| @@ -31,6 +36,7 @@ t.spec_files = Dir['spec/**/*_spec.rb'].sort t.libs = ['lib', 'server/lib' ] t.rcov = true + t.rcov_opts = ['--exclude-only', '"thisdoesntexist"', '--include-file', '^app,^lib'] t.rcov_dir = :meta / :coverage end @@ -54,9 +60,9 @@ # end desc 'Check everything over before commiting' -task :aok => [:'rcov:run', :'rcov:verify', :'rcov:open'] +task :aok => [:check_config, :'rcov:run', :'rcov:verify', :'rcov:open'] # desc 'Task run during continuous integration' -task :cruise => [:'rcov:run', :'rcov:verify'] +task :cruise => [:check_config, :'rcov:run', :'rcov:verify'] # Tasks for systems Dir[Merb.root / "systems" / "*"].each do |system|