diff options
Diffstat (limited to 'activemodel/test/cases')
-rw-r--r-- | activemodel/test/cases/helper.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/activemodel/test/cases/helper.rb b/activemodel/test/cases/helper.rb index e54c85938b..49783c2735 100644 --- a/activemodel/test/cases/helper.rb +++ b/activemodel/test/cases/helper.rb @@ -1,13 +1,12 @@ -bundled = "#{File.dirname(__FILE__)}/../vendor/gems/environment" -if File.exist?("#{bundled}.rb") - require bundled -else - $:.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") + $:.unshift("#{root}/activemodel/lib") end require 'config' - require 'active_model' # Show backtraces for deprecated behavior for quicker cleanup. |