diff options
Diffstat (limited to 'test/rexml/test_xml_declaration.rb')
-rw-r--r-- | test/rexml/test_xml_declaration.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/rexml/test_xml_declaration.rb b/test/rexml/test_xml_declaration.rb index a4d97c41d0..1d5a6d312f 100644 --- a/test/rexml/test_xml_declaration.rb +++ b/test/rexml/test_xml_declaration.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # frozen_string_literal: false # # Created by Henrik MÃ¥rtensson on 2007-02-18. @@ -10,11 +9,11 @@ require "test/unit" module REXMLTests class TestXmlDeclaration < Test::Unit::TestCase def setup - xml = <<-'END_XML' + xml = <<-XML <?xml encoding= 'UTF-8' standalone='yes'?> <root> </root> - END_XML + XML @doc = REXML::Document.new xml @root = @doc.root @xml_declaration = @doc.children[0] @@ -32,5 +31,12 @@ module REXMLTests assert_kind_of(REXML::XMLDecl, @root.previous_sibling.previous_sibling) assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling) end + + def test_write_prologue_quote + @doc.context[:prologue_quote] = :quote + assert_equal("<?xml version=\"1.0\" " + + "encoding=\"UTF-8\" standalone=\"yes\"?>", + @xml_declaration.to_s) + end end end |