aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-11-09 23:28:36 -0600
committerJoshua Peek <josh@joshpeek.com>2009-11-09 23:28:36 -0600
commit11e798ae0f2f46498811282756c9d21df3d4b523 (patch)
tree460a4afcd2b25cede89f2e2c785244dbcc97656f
parent23229d5ad4cf1c222d4d8c4561fbdff284f9bdee (diff)
downloadrails-11e798ae0f2f46498811282756c9d21df3d4b523.tar.gz
rails-11e798ae0f2f46498811282756c9d21df3d4b523.tar.bz2
rails-11e798ae0f2f46498811282756c9d21df3d4b523.zip
Avoid adding component lib/ to load path multiple times
-rw-r--r--actionmailer/test/abstract_unit.rb4
-rw-r--r--actionpack/test/abstract_unit.rb4
-rw-r--r--activemodel/test/cases/helper.rb4
-rw-r--r--activerecord/test/cases/helper.rb4
-rw-r--r--activeresource/test/abstract_unit.rb4
-rw-r--r--activesupport/test/abstract_unit.rb3
6 files changed, 17 insertions, 6 deletions
diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb
index fcbaa9e186..e84b3b0d23 100644
--- a/actionmailer/test/abstract_unit.rb
+++ b/actionmailer/test/abstract_unit.rb
@@ -4,9 +4,11 @@ begin
rescue LoadError
$:.unshift("#{root}/activesupport/lib")
$:.unshift("#{root}/actionpack/lib")
- $:.unshift("#{root}/actionmailer/lib")
end
+lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
+$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
+
require 'rubygems'
require 'test/unit'
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 32c5743382..775cfc82bf 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -6,7 +6,9 @@ rescue LoadError
$:.unshift "#{root}/activemodel/lib"
end
-$:.unshift(File.dirname(__FILE__) + '/../lib')
+lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
+$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
+
$:.unshift(File.dirname(__FILE__) + '/lib')
$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')
$:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers')
diff --git a/activemodel/test/cases/helper.rb b/activemodel/test/cases/helper.rb
index 49783c2735..c1a3f6a4a7 100644
--- a/activemodel/test/cases/helper.rb
+++ b/activemodel/test/cases/helper.rb
@@ -3,9 +3,11 @@ begin
require "#{root}/vendor/gems/environment"
rescue LoadError
$:.unshift("#{root}/activesupport/lib")
- $:.unshift("#{root}/activemodel/lib")
end
+lib = File.expand_path("#{File.dirname(__FILE__)}/../../lib")
+$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
+
require 'config'
require 'active_model'
diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb
index 871cfa6468..25613da912 100644
--- a/activerecord/test/cases/helper.rb
+++ b/activerecord/test/cases/helper.rb
@@ -3,9 +3,11 @@ begin
require "#{root}/vendor/gems/environment"
rescue LoadError
$:.unshift("#{root}/activesupport/lib")
- $:.unshift("#{root}/activerecord/lib")
end
+lib = File.expand_path("#{File.dirname(__FILE__)}/../../lib")
+$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
+
require 'config'
require 'rubygems'
diff --git a/activeresource/test/abstract_unit.rb b/activeresource/test/abstract_unit.rb
index ee12f785b5..10849be20c 100644
--- a/activeresource/test/abstract_unit.rb
+++ b/activeresource/test/abstract_unit.rb
@@ -3,9 +3,11 @@ begin
require "#{root}/vendor/gems/environment"
rescue LoadError
$:.unshift("#{root}/activesupport/lib")
- $:.unshift("#{root}/activeresource/lib")
end
+lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
+$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
+
require 'rubygems'
require 'test/unit'
require 'active_support'
diff --git a/activesupport/test/abstract_unit.rb b/activesupport/test/abstract_unit.rb
index d640c9bc63..dda139372e 100644
--- a/activesupport/test/abstract_unit.rb
+++ b/activesupport/test/abstract_unit.rb
@@ -5,7 +5,8 @@ begin
rescue LoadError
end
-$:.unshift(File.dirname(__FILE__) + '/../lib')
+lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
+$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
require 'test/unit'
require 'mocha'