Make sure AS test env doesn't have duplicate libs in load path
This commit is contained in:
parent
eec2d301d4
commit
4419497e40
@ -1,5 +1,4 @@
|
||||
require 'test/unit'
|
||||
$:.unshift "#{File.dirname(__FILE__)}/../lib"
|
||||
require 'active_support'
|
||||
|
||||
class GrandParent
|
||||
|
@ -1,6 +1,5 @@
|
||||
# require 'abstract_unit'
|
||||
require 'test/unit'
|
||||
$:.unshift "#{File.dirname(__FILE__)}/../lib"
|
||||
require 'active_support'
|
||||
|
||||
module CallbacksTest
|
||||
|
14
activesupport/test/load_paths_test.rb
Normal file
14
activesupport/test/load_paths_test.rb
Normal file
@ -0,0 +1,14 @@
|
||||
require 'abstract_unit'
|
||||
|
||||
class LoadPathsTest < Test::Unit::TestCase
|
||||
def test_uniq_load_paths
|
||||
load_paths_count = $LOAD_PATH.inject({}) { |paths, path|
|
||||
expanded_path = File.expand_path(path)
|
||||
paths[expanded_path] ||= 0
|
||||
paths[expanded_path] += 1
|
||||
paths
|
||||
}
|
||||
|
||||
assert_equal [], load_paths_count.select { |k, v| v > 1 }, $LOAD_PATH.inspect
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user