aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/test/cases/helper.rb')
-rw-r--r--activemodel/test/cases/helper.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/activemodel/test/cases/helper.rb b/activemodel/test/cases/helper.rb
index 3c0bd15236..c1a3f6a4a7 100644
--- a/activemodel/test/cases/helper.rb
+++ b/activemodel/test/cases/helper.rb
@@ -1,8 +1,14 @@
-$:.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
-require 'config'
+lib = File.expand_path("#{File.dirname(__FILE__)}/../../lib")
+$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
+require 'config'
require 'active_model'
# Show backtraces for deprecated behavior for quicker cleanup.