From 27670363926ee341078aa69ae27204d7338037f5 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 19 Oct 2009 19:00:48 -0700 Subject: [PATCH] Use bundled env for tests only --- activerecord/Gemfile | 6 ++---- activerecord/lib/active_record.rb | 13 ++++--------- activerecord/test/cases/helper.rb | 8 +++++++- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/activerecord/Gemfile b/activerecord/Gemfile index 9cf37b0af0f6a..3201e65f02563 100644 --- a/activerecord/Gemfile +++ b/activerecord/Gemfile @@ -3,8 +3,6 @@ sibling = "#{File.dirname(__FILE__)}/.." gem "activesupport", "3.0.pre", :vendored_at => "#{sibling}/activesupport" gem "activemodel", "3.0.pre", :vendored_at => "#{sibling}/activemodel" -gem "arel", :git => "git://github.com/rails/arel.git", :branch => 'master' +gem "arel", :git => "git://github.com/rails/arel.git" -only :test do - gem "mocha" -end +gem "mocha" diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb index 8f118a60572ec..88becfb482240 100644 --- a/activerecord/lib/active_record.rb +++ b/activerecord/lib/active_record.rb @@ -21,16 +21,11 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ -bundled = "#{File.dirname(__FILE__)}/../vendor/gems/environment" -if File.exist?("#{bundled}.rb") - require bundled -else - activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib" - $:.unshift(activesupport_path) if File.directory?(activesupport_path) +activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib" +$:.unshift(activesupport_path) if File.directory?(activesupport_path) - activemodel_path = "#{File.dirname(__FILE__)}/../../activemodel/lib" - $:.unshift(activemodel_path) if File.directory?(activemodel_path) -end +activemodel_path = "#{File.dirname(__FILE__)}/../../activemodel/lib" +$:.unshift(activemodel_path) if File.directory?(activemodel_path) require 'active_support' require 'active_model' diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb index aa09c7061fa0c..63014c0297991 100644 --- a/activerecord/test/cases/helper.rb +++ b/activerecord/test/cases/helper.rb @@ -1,5 +1,11 @@ $:.unshift(File.dirname(__FILE__) + '/../../lib') -$:.unshift(File.dirname(__FILE__) + '/../../../activesupport/lib') + +bundled = "#{File.dirname(__FILE__)}/../../vendor/gems/environment" +if File.exist?("#{bundled}.rb") + require bundled +else + $:.unshift(File.dirname(__FILE__) + '/../../../activesupport/lib') +end require 'config'