aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/test/abstract_unit.rb5
-rw-r--r--activesupport/test/callback_inheritance_test.rb1
-rw-r--r--activesupport/test/callbacks_test.rb1
-rw-r--r--activesupport/test/core_ext/class/delegating_attributes_test.rb2
-rw-r--r--activesupport/test/load_paths_test.rb15
5 files changed, 21 insertions, 3 deletions
diff --git a/activesupport/test/abstract_unit.rb b/activesupport/test/abstract_unit.rb
index 33be6f65bf..c4ef102bf0 100644
--- a/activesupport/test/abstract_unit.rb
+++ b/activesupport/test/abstract_unit.rb
@@ -1,4 +1,7 @@
-require File.expand_path('../../../load_paths', __FILE__)
+require File.expand_path('../../../bundler', __FILE__)
+
+lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
+$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
require 'test/unit'
require 'mocha'
diff --git a/activesupport/test/callback_inheritance_test.rb b/activesupport/test/callback_inheritance_test.rb
index 2e978f01be..e74c64ba8d 100644
--- a/activesupport/test/callback_inheritance_test.rb
+++ b/activesupport/test/callback_inheritance_test.rb
@@ -1,5 +1,4 @@
require 'test/unit'
-$:.unshift "#{File.dirname(__FILE__)}/../lib"
require 'active_support'
class GrandParent
diff --git a/activesupport/test/callbacks_test.rb b/activesupport/test/callbacks_test.rb
index 11494e951e..3fb940ad3c 100644
--- a/activesupport/test/callbacks_test.rb
+++ b/activesupport/test/callbacks_test.rb
@@ -1,6 +1,5 @@
# require 'abstract_unit'
require 'test/unit'
-$:.unshift "#{File.dirname(__FILE__)}/../lib"
require 'active_support'
module CallbacksTest
diff --git a/activesupport/test/core_ext/class/delegating_attributes_test.rb b/activesupport/test/core_ext/class/delegating_attributes_test.rb
index 011068ab74..636edb8d4b 100644
--- a/activesupport/test/core_ext/class/delegating_attributes_test.rb
+++ b/activesupport/test/core_ext/class/delegating_attributes_test.rb
@@ -84,6 +84,8 @@ class DelegatingAttributesTest < Test::Unit::TestCase
assert_equal "1", Child.some_attribute
assert_nil Mokopuna.some_attribute
+ ensure
+ Child.some_attribute=nil
end
end
diff --git a/activesupport/test/load_paths_test.rb b/activesupport/test/load_paths_test.rb
new file mode 100644
index 0000000000..9c83d6f061
--- /dev/null
+++ b/activesupport/test/load_paths_test.rb
@@ -0,0 +1,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
+ }
+
+ # CI has a bunch of duplicate load paths
+ # assert_equal [], load_paths_count.select { |k, v| v > 1 }, $LOAD_PATH.inspect
+ end
+end