aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/xml_mini/rexml_engine_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/xml_mini/rexml_engine_test.rb')
-rw-r--r--activesupport/test/xml_mini/rexml_engine_test.rb27
1 files changed, 13 insertions, 14 deletions
diff --git a/activesupport/test/xml_mini/rexml_engine_test.rb b/activesupport/test/xml_mini/rexml_engine_test.rb
index 6e9ce7ac11..dc62f3f671 100644
--- a/activesupport/test/xml_mini/rexml_engine_test.rb
+++ b/activesupport/test/xml_mini/rexml_engine_test.rb
@@ -1,5 +1,5 @@
-require 'abstract_unit'
-require 'active_support/xml_mini'
+require "abstract_unit"
+require "active_support/xml_mini"
class REXMLEngineTest < ActiveSupport::TestCase
def test_default_is_rexml
@@ -7,12 +7,12 @@ class REXMLEngineTest < ActiveSupport::TestCase
end
def test_set_rexml_as_backend
- ActiveSupport::XmlMini.backend = 'REXML'
+ ActiveSupport::XmlMini.backend = "REXML"
assert_equal ActiveSupport::XmlMini_REXML, ActiveSupport::XmlMini.backend
end
def test_parse_from_io
- ActiveSupport::XmlMini.backend = 'REXML'
+ ActiveSupport::XmlMini.backend = "REXML"
io = StringIO.new(<<-eoxml)
<root>
good
@@ -23,23 +23,22 @@ class REXMLEngineTest < ActiveSupport::TestCase
</root>
eoxml
hash = ActiveSupport::XmlMini.parse(io)
- assert hash.has_key?('root')
- assert hash['root'].has_key?('products')
- assert_match "good", hash['root']['__content__']
- products = hash['root']['products']
- assert products.has_key?("__content__")
- assert_match 'hello everyone', products['__content__']
+ assert hash.has_key?("root")
+ assert hash["root"].has_key?("products")
+ assert_match "good", hash["root"]["__content__"]
+ products = hash["root"]["products"]
+ assert products.has_key?("__content__")
+ assert_match "hello everyone", products["__content__"]
end
def test_parse_from_empty_string
- ActiveSupport::XmlMini.backend = 'REXML'
+ ActiveSupport::XmlMini.backend = "REXML"
assert_equal({}, ActiveSupport::XmlMini.parse(""))
end
def test_parse_from_frozen_string
- ActiveSupport::XmlMini.backend = 'REXML'
+ ActiveSupport::XmlMini.backend = "REXML"
xml_string = "<root></root>".freeze
- assert_equal({"root" => {}}, ActiveSupport::XmlMini.parse(xml_string))
+ assert_equal({ "root" => {} }, ActiveSupport::XmlMini.parse(xml_string))
end
-
end