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:
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user