Permalink
Browse files

Make sure AS test env doesn't have duplicate libs in load path

  • Loading branch information...
1 parent eec2d30 commit 4419497e403387a3cc93c4c1a3b6a07314a85e43 @josh josh committed Feb 15, 2010
@@ -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
@@ -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

0 comments on commit 4419497

Please sign in to comment.