From 6f42cda5ca07796344a845e8e38353627c5fb20a Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Sun, 30 Nov 2008 01:12:12 -0800 Subject: [PATCH] Allow the loading of a external Redmine environment * If the REDMINE_ROOT environment variable is set, it will be used to load the Rails environment. This will allow the plugin to be tested outside of a Redmine's vendor/plugins directory --- spec/spec_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 421b198..a8132b4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,11 @@ # This file is copied to ~/spec when you run 'ruby script/generate rspec' # from the project root directory. ENV["RAILS_ENV"] = "test" -require File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment") + +# Allows loading of an environment config based on the environment +redmine_root = ENV["REDMINE_ROOT"] || File.dirname(__FILE__) + "/../../../.." +require File.expand_path(redmine_root + "/config/environment") + require 'spec' require 'spec/rails'