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
This commit is contained in:
Eric Davis
2008-11-30 01:12:12 -08:00
parent 4897e6c228
commit 6f42cda5ca

View File

@@ -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'