diff --git a/Rakefile b/Rakefile index 33231be..536f961 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,13 @@ # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. +# These rake tasks should always be run in the 'test' environment and the +# environment name must be set before loading the Rails application +test_env_tasks = %w(spec) +if Rake.application.top_level_tasks.any? { |t| test_env_tasks.include?(t) } + ENV['RAILS_ENV'] = 'test' +end + require File.expand_path('../config/application', __FILE__) Rails.application.load_tasks -- libgit2 0.21.2