diff options
author | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-16 18:49:26 +0900 |
---|---|---|
committer | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-30 00:39:06 +0900 |
commit | fcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch) | |
tree | 64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/test/rexml/test_xml_declaration.rb |
Fresh start
Diffstat (limited to 'jni/ruby/test/rexml/test_xml_declaration.rb')
-rw-r--r-- | jni/ruby/test/rexml/test_xml_declaration.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/jni/ruby/test/rexml/test_xml_declaration.rb b/jni/ruby/test/rexml/test_xml_declaration.rb new file mode 100644 index 0000000..a96d40c --- /dev/null +++ b/jni/ruby/test/rexml/test_xml_declaration.rb @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# +# Created by Henrik MÃ¥rtensson on 2007-02-18. +# Copyright (c) 2007. All rights reserved. + +require "rexml/document" +require "test/unit" + +module REXMLTests + class TestXmlDeclaration < Test::Unit::TestCase + def setup + xml = <<-'END_XML' + <?xml encoding= 'UTF-8' standalone='yes'?> + <root> + </root> + END_XML + @doc = REXML::Document.new xml + @root = @doc.root + @xml_declaration = @doc.children[0] + end + + def test_is_first_child + assert_kind_of(REXML::XMLDecl, @xml_declaration) + end + + def test_has_document_as_parent + assert_kind_of(REXML::Document, @xml_declaration.parent) + end + + def test_has_sibling + assert_kind_of(REXML::XMLDecl, @root.previous_sibling.previous_sibling) + assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling) + end + end +end |