lib/generators/extension/templates/test_helper.rb in radiant-0.6.4 vs lib/generators/extension/templates/test_helper.rb in radiant-0.6.5
- old
+ new
@@ -1,9 +1,16 @@
require 'test/unit'
-# # Load the environment
+# Load the environment
unless defined? RADIANT_ROOT
ENV["RAILS_ENV"] = "test"
- require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
+ case
+ when ENV["RADIANT_ENV_FILE"]
+ require ENV["RADIANT_ENV_FILE"]
+ when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
+ require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
+ else
+ require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
+ end
end
require "#{RADIANT_ROOT}/test/test_helper"
class Test::Unit::TestCase
\ No newline at end of file