2010-02-15 11:38:39 -05:00
|
|
|
require 'abstract_unit'
|
|
|
|
|
2012-01-05 20:12:46 -05:00
|
|
|
class LoadPathsTest < ActiveSupport::TestCase
|
2010-02-15 11:38:39 -05:00
|
|
|
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
|
|
|
|
}
|
2010-07-24 16:17:47 -04:00
|
|
|
load_paths_count[File.expand_path('../../lib', __FILE__)] -= 1
|
2010-02-15 11:38:39 -05:00
|
|
|
|
2011-05-22 07:20:59 -04:00
|
|
|
filtered = load_paths_count.select { |k, v| v > 1 }
|
|
|
|
assert filtered.empty?, filtered.inspect
|
2010-02-15 11:38:39 -05:00
|
|
|
end
|
|
|
|
end
|