aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/helper.rb')
-rw-r--r--activerecord/test/cases/helper.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb
index aa09c7061f..25613da912 100644
--- a/activerecord/test/cases/helper.rb
+++ b/activerecord/test/cases/helper.rb
@@ -1,5 +1,12 @@
-$:.unshift(File.dirname(__FILE__) + '/../../lib')
-$:.unshift(File.dirname(__FILE__) + '/../../../activesupport/lib')
+root = File.expand_path('../../../..', __FILE__)
+begin
+ require "#{root}/vendor/gems/environment"
+rescue LoadError
+ $:.unshift("#{root}/activesupport/lib")
+end
+
+lib = File.expand_path("#{File.dirname(__FILE__)}/../../lib")
+$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
require 'config'