aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/load_paths_test.rb
blob: 36e3726a023f725283b5c3d16dfccdbe631f4484 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
    }
    load_paths_count[File.expand_path('../../lib', __FILE__)] -= 1

    assert load_paths_count.select { |k, v| v > 1 }.empty?, $LOAD_PATH.inspect
  end
end