Delete AS::Dependencies.qualified_name_for

This commit is contained in:
Xavier Noria 2021-08-18 22:52:36 +02:00
parent 1b92154ff4
commit e24ae73021
2 changed files with 0 additions and 16 deletions

View File

@ -224,12 +224,6 @@ module ActiveSupport # :nodoc:
autoload_once_paths.any? { |base| path.start_with?(base.to_s) }
end
# Returns the constant path for the provided parent and constant name.
def qualified_name_for(mod, name)
mod_name = to_constant_name mod
mod_name == "Object" ? name.to_s : "#{mod_name}::#{name}"
end
# Get the reference for class named +name+.
# Raises an exception if referenced class does not exist.
def constantize(name)

View File

@ -54,16 +54,6 @@ class DependenciesTest < ActiveSupport::TestCase
assert_raises(NameError) { ActiveSupport::Dependencies.qualified_const_defined?("invalid") }
end
def test_qualified_name_for
assert_equal "A", ActiveSupport::Dependencies.qualified_name_for(Object, :A)
assert_equal "A", ActiveSupport::Dependencies.qualified_name_for(:Object, :A)
assert_equal "A", ActiveSupport::Dependencies.qualified_name_for("Object", :A)
assert_equal "A", ActiveSupport::Dependencies.qualified_name_for("::Object", :A)
assert_equal "ActiveSupport::Dependencies::A", ActiveSupport::Dependencies.qualified_name_for(:'ActiveSupport::Dependencies', :A)
assert_equal "ActiveSupport::Dependencies::A", ActiveSupport::Dependencies.qualified_name_for(ActiveSupport::Dependencies, :A)
end
def test_new_constants_in_with_inherited_constants
m = ActiveSupport::Dependencies.new_constants_in(:Object) do
Object.class_eval { include ModuleWithConstant }