1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/test/load_paths_test.rb

17 lines
472 B
Ruby
Raw Normal View History

require 'abstract_unit'
2012-01-05 20:12:46 -05:00
class LoadPathsTest < ActiveSupport::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
}
load_paths_count[File.expand_path('../../lib', __FILE__)] -= 1
2013-06-12 01:48:35 -04:00
load_paths_count.select! { |k, v| v > 1 }
assert load_paths_count.empty?, load_paths_count.inspect
end
end