From 4484f0bccf1b02ff1d05d7310afe2e572befce46 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 14 Oct 2009 20:59:45 -0700 Subject: [PATCH] Don't push siblings on load path if using bundled env --- actionmailer/test/abstract_unit.rb | 10 ++++++++-- actionpack/test/abstract_unit.rb | 13 ++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb index 3d4d0fb995..69af5d90a9 100644 --- a/actionmailer/test/abstract_unit.rb +++ b/actionmailer/test/abstract_unit.rb @@ -1,9 +1,15 @@ +bundled = "#{File.dirname(__FILE__)}/../vendor/gems/environment" +if File.exist?("#{bundled}.rb") + require bundled +else + $:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib" + $:.unshift "#{File.dirname(__FILE__)}/../../actionpack/lib" +end + require 'rubygems' require 'test/unit' $:.unshift "#{File.dirname(__FILE__)}/../lib" -$:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib" -$:.unshift "#{File.dirname(__FILE__)}/../../actionpack/lib" require 'action_mailer' require 'action_mailer/test_case' diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 4820f00aa1..0d65bdb5b9 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -1,14 +1,17 @@ +bundled = "#{File.dirname(__FILE__)}/../vendor/gems/environment" +if File.exist?("#{bundled}.rb") + require bundled +else + $:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib" + $:.unshift "#{File.dirname(__FILE__)}/../../activemodel/lib" +end + $:.unshift(File.dirname(__FILE__) + '/../lib') -$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib') -$:.unshift(File.dirname(__FILE__) + '/../../activemodel/lib') $:.unshift(File.dirname(__FILE__) + '/lib') $:.unshift(File.dirname(__FILE__) + '/fixtures/helpers') $:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers') -bundler = File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'environment') -require bundler if File.exist?("#{bundler}.rb") - begin %w( rack rack/test sqlite3 ).each { |lib| require lib } rescue LoadError => e