From 8778e1c4af499ae42da10c1cc07a4eb2736199ac Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Tue, 12 Mar 2013 10:33:32 +0530 Subject: Fix typo in DependenciesTestHelpers module name --- activesupport/test/caching_test.rb | 4 ++-- activesupport/test/core_ext/marshal_test.rb | 4 ++-- activesupport/test/dependecies_test_helpers.rb | 27 ------------------------- activesupport/test/dependencies_test.rb | 4 ++-- activesupport/test/dependencies_test_helpers.rb | 27 +++++++++++++++++++++++++ 5 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 activesupport/test/dependecies_test_helpers.rb create mode 100644 activesupport/test/dependencies_test_helpers.rb (limited to 'activesupport/test') diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index ede08e23d5..acd320dbe0 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -1,7 +1,7 @@ require 'logger' require 'abstract_unit' require 'active_support/cache' -require 'dependecies_test_helpers' +require 'dependencies_test_helpers' class CacheKeyTest < ActiveSupport::TestCase def test_entry_legacy_optional_ivars @@ -564,7 +564,7 @@ module LocalCacheBehavior end module AutoloadingCacheBehavior - include DependeciesTestHelpers + include DependenciesTestHelpers def test_simple_autoloading with_autoloading_fixtures do @cache.write('foo', E.new) diff --git a/activesupport/test/core_ext/marshal_test.rb b/activesupport/test/core_ext/marshal_test.rb index ac79b15fa8..8f3f710dfd 100644 --- a/activesupport/test/core_ext/marshal_test.rb +++ b/activesupport/test/core_ext/marshal_test.rb @@ -1,10 +1,10 @@ require 'abstract_unit' require 'active_support/core_ext/marshal' -require 'dependecies_test_helpers' +require 'dependencies_test_helpers' class MarshalTest < ActiveSupport::TestCase include ActiveSupport::Testing::Isolation - include DependeciesTestHelpers + include DependenciesTestHelpers def teardown ActiveSupport::Dependencies.clear diff --git a/activesupport/test/dependecies_test_helpers.rb b/activesupport/test/dependecies_test_helpers.rb deleted file mode 100644 index 4b46d32fb4..0000000000 --- a/activesupport/test/dependecies_test_helpers.rb +++ /dev/null @@ -1,27 +0,0 @@ -module DependeciesTestHelpers - def with_loading(*from) - old_mechanism, ActiveSupport::Dependencies.mechanism = ActiveSupport::Dependencies.mechanism, :load - this_dir = File.dirname(__FILE__) - parent_dir = File.dirname(this_dir) - path_copy = $LOAD_PATH.dup - $LOAD_PATH.unshift(parent_dir) unless $LOAD_PATH.include?(parent_dir) - prior_autoload_paths = ActiveSupport::Dependencies.autoload_paths - ActiveSupport::Dependencies.autoload_paths = from.collect { |f| "#{this_dir}/#{f}" } - yield - ensure - $LOAD_PATH.replace(path_copy) - ActiveSupport::Dependencies.autoload_paths = prior_autoload_paths - ActiveSupport::Dependencies.mechanism = old_mechanism - ActiveSupport::Dependencies.explicitly_unloadable_constants = [] - end - - def with_autoloading_fixtures(&block) - with_loading 'autoloading_fixtures', &block - end - - def remove_constants(*constants) - constants.each do |constant| - Object.send(:remove_const, constant) if Object.const_defined?(constant) - end - end -end \ No newline at end of file diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index 615808090d..c278f8384f 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -1,7 +1,7 @@ require 'abstract_unit' require 'pp' require 'active_support/dependencies' -require 'dependecies_test_helpers' +require 'dependencies_test_helpers' module ModuleWithMissing mattr_accessor :missing_count @@ -20,7 +20,7 @@ class DependenciesTest < ActiveSupport::TestCase ActiveSupport::Dependencies.clear end - include DependeciesTestHelpers + include DependenciesTestHelpers def test_depend_on_path skip "LoadError#path does not exist" if RUBY_VERSION < '2.0.0' diff --git a/activesupport/test/dependencies_test_helpers.rb b/activesupport/test/dependencies_test_helpers.rb new file mode 100644 index 0000000000..9268512a97 --- /dev/null +++ b/activesupport/test/dependencies_test_helpers.rb @@ -0,0 +1,27 @@ +module DependenciesTestHelpers + def with_loading(*from) + old_mechanism, ActiveSupport::Dependencies.mechanism = ActiveSupport::Dependencies.mechanism, :load + this_dir = File.dirname(__FILE__) + parent_dir = File.dirname(this_dir) + path_copy = $LOAD_PATH.dup + $LOAD_PATH.unshift(parent_dir) unless $LOAD_PATH.include?(parent_dir) + prior_autoload_paths = ActiveSupport::Dependencies.autoload_paths + ActiveSupport::Dependencies.autoload_paths = from.collect { |f| "#{this_dir}/#{f}" } + yield + ensure + $LOAD_PATH.replace(path_copy) + ActiveSupport::Dependencies.autoload_paths = prior_autoload_paths + ActiveSupport::Dependencies.mechanism = old_mechanism + ActiveSupport::Dependencies.explicitly_unloadable_constants = [] + end + + def with_autoloading_fixtures(&block) + with_loading 'autoloading_fixtures', &block + end + + def remove_constants(*constants) + constants.each do |constant| + Object.send(:remove_const, constant) if Object.const_defined?(constant) + end + end +end \ No newline at end of file -- cgit v1.2.3