mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove String#constantize deps
This commit is contained in:
parent
cfc9439454
commit
ed61c3b640
2 changed files with 9 additions and 8 deletions
|
@ -153,7 +153,7 @@ module ActiveSupport #:nodoc:
|
|||
|
||||
nesting.each do |namespace|
|
||||
begin
|
||||
return Dependencies.load_missing_constant namespace.constantize, const_name
|
||||
return Dependencies.load_missing_constant Inflector.constantize(namespace), const_name
|
||||
rescue NoMethodError then raise
|
||||
rescue NameError => e
|
||||
error ||= e
|
||||
|
|
|
@ -940,13 +940,14 @@ class HashToXmlTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_expansion_count_is_limited
|
||||
expected = {
|
||||
'ActiveSupport::XmlMini_REXML' => 'RuntimeError',
|
||||
'ActiveSupport::XmlMini_Nokogiri' => 'Nokogiri::XML::SyntaxError',
|
||||
'ActiveSupport::XmlMini_NokogiriSAX' => 'RuntimeError',
|
||||
'ActiveSupport::XmlMini_LibXML' => 'LibXML::XML::Error',
|
||||
'ActiveSupport::XmlMini_LibXMLSAX' => 'LibXML::XML::Error',
|
||||
}[ActiveSupport::XmlMini.backend.name].constantize
|
||||
expected =
|
||||
case ActiveSupport::XmlMini.backend.name
|
||||
when 'ActiveSupport::XmlMini_REXML'; RuntimeError
|
||||
when 'ActiveSupport::XmlMini_Nokogiri'; Nokogiri::XML::SyntaxError
|
||||
when 'ActiveSupport::XmlMini_NokogiriSAX'; RuntimeError
|
||||
when 'ActiveSupport::XmlMini_LibXML'; LibXML::XML::Error
|
||||
when 'ActiveSupport::XmlMini_LibXMLSAX'; LibXML::XML::Error
|
||||
end
|
||||
|
||||
assert_raise expected do
|
||||
attack_xml = <<-EOT
|
||||
|
|
Loading…
Reference in a new issue