mirror of https://github.com/rails/rails
Delete AS::Dependencies.qualified_name_for
This commit is contained in:
parent
1b92154ff4
commit
e24ae73021
|
@ -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)
|
||||
|
|
|
@ -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 }
|
||||
|
|
Loading…
Reference in New Issue