Avoid adding component lib/ to load path multiple times

This commit is contained in:
Joshua Peek 2009-11-09 23:28:36 -06:00
parent 23229d5ad4
commit 11e798ae0f
6 changed files with 17 additions and 6 deletions

@ -4,9 +4,11 @@
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'

@ -6,7 +6,9 @@
$:.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')

@ -3,9 +3,11 @@
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'

@ -3,9 +3,11 @@
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'

@ -3,9 +3,11 @@
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'

@ -5,7 +5,8 @@
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'