aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/xml_mini/nokogirisax_engine_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 18:03:25 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:10:53 +0200
commita731125f12c5834de7eae3455fad63ea4d348034 (patch)
tree0ada76c652c1a2a1fd68cdbecf5adc2df6beeb51 /activesupport/test/xml_mini/nokogirisax_engine_test.rb
parentd66e7835bea9505f7003e5038aa19b6ea95ceea1 (diff)
downloadrails-a731125f12c5834de7eae3455fad63ea4d348034.tar.gz
rails-a731125f12c5834de7eae3455fad63ea4d348034.tar.bz2
rails-a731125f12c5834de7eae3455fad63ea4d348034.zip
applies new string literal convention in activesupport/test
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'activesupport/test/xml_mini/nokogirisax_engine_test.rb')
-rw-r--r--activesupport/test/xml_mini/nokogirisax_engine_test.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/activesupport/test/xml_mini/nokogirisax_engine_test.rb b/activesupport/test/xml_mini/nokogirisax_engine_test.rb
index 7978a50921..9a2bcc3f7e 100644
--- a/activesupport/test/xml_mini/nokogirisax_engine_test.rb
+++ b/activesupport/test/xml_mini/nokogirisax_engine_test.rb
@@ -1,16 +1,16 @@
begin
- require 'nokogiri'
+ require "nokogiri"
rescue LoadError
# Skip nokogiri tests
else
-require 'abstract_unit'
-require 'active_support/xml_mini'
-require 'active_support/core_ext/hash/conversions'
+require "abstract_unit"
+require "active_support/xml_mini"
+require "active_support/core_ext/hash/conversions"
class NokogiriSAXEngineTest < ActiveSupport::TestCase
def setup
@default_backend = ActiveSupport::XmlMini.backend
- ActiveSupport::XmlMini.backend = 'NokogiriSAX'
+ ActiveSupport::XmlMini.backend = "NokogiriSAX"
end
def teardown
@@ -24,12 +24,12 @@ class NokogiriSAXEngineTest < ActiveSupport::TestCase
</logo>
</blog>
eoxml
- assert hash.has_key?('blog')
- assert hash['blog'].has_key?('logo')
+ assert hash.has_key?("blog")
+ assert hash["blog"].has_key?("logo")
- file = hash['blog']['logo']
- assert_equal 'logo.png', file.original_filename
- assert_equal 'image/png', file.content_type
+ file = hash["blog"]["logo"]
+ assert_equal "logo.png", file.original_filename
+ assert_equal "image/png", file.content_type
end
def test_exception_thrown_on_expansion_attack
@@ -55,13 +55,13 @@ class NokogiriSAXEngineTest < ActiveSupport::TestCase
end
def test_setting_nokogirisax_as_backend
- ActiveSupport::XmlMini.backend = 'NokogiriSAX'
+ ActiveSupport::XmlMini.backend = "NokogiriSAX"
assert_equal ActiveSupport::XmlMini_NokogiriSAX, ActiveSupport::XmlMini.backend
end
def test_blank_returns_empty_hash
assert_equal({}, ActiveSupport::XmlMini.parse(nil))
- assert_equal({}, ActiveSupport::XmlMini.parse(''))
+ assert_equal({}, ActiveSupport::XmlMini.parse(""))
end
def test_array_type_makes_an_array
@@ -208,7 +208,7 @@ class NokogiriSAXEngineTest < ActiveSupport::TestCase
def assert_equal_rexml(xml)
parsed_xml = ActiveSupport::XmlMini.parse(xml)
xml.rewind if xml.respond_to?(:rewind)
- hash = ActiveSupport::XmlMini.with_backend('REXML') { ActiveSupport::XmlMini.parse(xml) }
+ hash = ActiveSupport::XmlMini.with_backend("REXML") { ActiveSupport::XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end
end