Skip to content

Commit

Permalink
Remove useless load path modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed May 11, 2012
1 parent a00228c commit 36dd185
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 38 deletions.
3 changes: 0 additions & 3 deletions actionmailer/lib/action_mailer.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++ #++


actionpack_path = File.expand_path('../../../actionpack/lib', __FILE__)
$:.unshift(actionpack_path) if File.directory?(actionpack_path) && !$:.include?(actionpack_path)

require 'abstract_controller' require 'abstract_controller'
require 'action_view' require 'action_view'
require 'action_mailer/version' require 'action_mailer/version'
Expand Down
3 changes: 0 additions & 3 deletions actionmailer/test/abstract_unit.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
Encoding.default_external = "UTF-8" Encoding.default_external = "UTF-8"
end end


lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)

require 'minitest/autorun' require 'minitest/autorun'
require 'action_mailer' require 'action_mailer'
require 'action_mailer/test_case' require 'action_mailer/test_case'
Expand Down
3 changes: 0 additions & 3 deletions actionpack/lib/abstract_controller.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,3 @@
activesupport_path = File.expand_path('../../../activesupport/lib', __FILE__)
$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)

require 'action_pack' require 'action_pack'
require 'active_support/concern' require 'active_support/concern'
require 'active_support/dependencies/autoload' require 'active_support/dependencies/autoload'
Expand Down
6 changes: 0 additions & 6 deletions actionpack/lib/action_dispatch.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++ #++


activesupport_path = File.expand_path('../../../activesupport/lib', __FILE__)
$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)

activemodel_path = File.expand_path('../../../activemodel/lib', __FILE__)
$:.unshift(activemodel_path) if File.directory?(activemodel_path) && !$:.include?(activemodel_path)

require 'active_support' require 'active_support'
require 'active_support/dependencies/autoload' require 'active_support/dependencies/autoload'
require 'active_support/core_ext/module/attribute_accessors' require 'active_support/core_ext/module/attribute_accessors'
Expand Down
6 changes: 0 additions & 6 deletions actionpack/test/abstract_unit.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,11 +1,5 @@
require File.expand_path('../../../load_paths', __FILE__) require File.expand_path('../../../load_paths', __FILE__)


lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)

activemodel_path = File.expand_path('../../../activemodel/lib', __FILE__)
$:.unshift(activemodel_path) if File.directory?(activemodel_path) && !$:.include?(activemodel_path)

$:.unshift(File.dirname(__FILE__) + '/lib') $:.unshift(File.dirname(__FILE__) + '/lib')
$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers') $:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')
$:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers') $:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers')
Expand Down
3 changes: 0 additions & 3 deletions actionpack/test/ts_isolated.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,3 @@
$:.unshift(File.dirname(__FILE__))
$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib')

require 'minitest/autorun' require 'minitest/autorun'
require 'rbconfig' require 'rbconfig'
require 'abstract_unit' require 'abstract_unit'
Expand Down
2 changes: 0 additions & 2 deletions activemodel/lib/active_model.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++ #++


activesupport_path = File.expand_path('../../../activesupport/lib', __FILE__)
$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)
require 'active_support' require 'active_support'
require 'active_model/version' require 'active_model/version'


Expand Down
3 changes: 0 additions & 3 deletions activemodel/test/cases/helper.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,5 @@
require File.expand_path('../../../../load_paths', __FILE__) require File.expand_path('../../../../load_paths', __FILE__)


lib = File.expand_path("#{File.dirname(__FILE__)}/../../lib")
$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)

require 'config' require 'config'
require 'active_model' require 'active_model'
require 'active_support/core_ext/string/access' require 'active_support/core_ext/string/access'
Expand Down
3 changes: 0 additions & 3 deletions activesupport/test/abstract_unit.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
$VERBOSE = old $VERBOSE = old
end end


lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)

require 'active_support/core_ext/kernel/reporting' require 'active_support/core_ext/kernel/reporting'
require 'active_support/core_ext/string/encoding' require 'active_support/core_ext/string/encoding'


Expand Down
2 changes: 0 additions & 2 deletions activesupport/test/ts_isolated.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,3 @@
$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib')

require 'minitest/autorun' require 'minitest/autorun'
require 'active_support/test_case' require 'active_support/test_case'
require 'rbconfig' require 'rbconfig'
Expand Down
3 changes: 2 additions & 1 deletion railties/Rakefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ namespace :test do
'test', 'test',
'lib', 'lib',
"#{File.dirname(__FILE__)}/../activesupport/lib", "#{File.dirname(__FILE__)}/../activesupport/lib",
"#{File.dirname(__FILE__)}/../actionpack/lib" "#{File.dirname(__FILE__)}/../actionpack/lib",
"#{File.dirname(__FILE__)}/../activemodel/lib"
] ]
ruby "-I#{dash_i.join ':'}", file ruby "-I#{dash_i.join ':'}", file
end end
Expand Down
5 changes: 2 additions & 3 deletions railties/test/isolation/abstract_unit.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@


# These files do not require any others and are needed # These files do not require any others and are needed
# to run the tests # to run the tests
require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/testing/isolation" require "active_support/testing/isolation"
require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/core_ext/kernel/reporting" require "active_support/core_ext/kernel/reporting"


module TestHelpers module TestHelpers
module Paths module Paths
Expand Down Expand Up @@ -248,7 +248,6 @@ def controller(name, contents)


def use_frameworks(arr) def use_frameworks(arr)
to_remove = [:actionmailer, to_remove = [:actionmailer,
:activemodel,
:activerecord] - arr :activerecord] - arr
if to_remove.include? :activerecord if to_remove.include? :activerecord
remove_from_config "config.active_record.whitelist_attributes = true" remove_from_config "config.active_record.whitelist_attributes = true"
Expand Down

0 comments on commit 36dd185

Please sign in to comment.