1
0
Fork 0
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:
Jeremy Kemper 2010-06-11 10:33:43 -07:00
parent cfc9439454
commit ed61c3b640
2 changed files with 9 additions and 8 deletions

View file

@ -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

View file

@ -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