Wrap REXML test classes by REXML module.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-05-27 10:21:10 +00:00
Родитель 1c35277c2b
Коммит 13a8d735d9
39 изменённых файлов: 78 добавлений и 3 удалений

Просмотреть файл

@ -1,6 +1,7 @@
require "test/unit" require "test/unit"
require "rexml/document" require "rexml/document"
module REXML
class TestParseDocumentTypeDeclaration < Test::Unit::TestCase class TestParseDocumentTypeDeclaration < Test::Unit::TestCase
private private
def xml(internal_subset) def xml(internal_subset)
@ -45,3 +46,4 @@ class TestParseDocumentTypeDeclaration < Test::Unit::TestCase
end end
end end
end end
end

Просмотреть файл

@ -1,6 +1,7 @@
require 'test/unit' require 'test/unit'
require 'rexml/document' require 'rexml/document'
module REXML
class TestParseNotationDeclaration < Test::Unit::TestCase class TestParseNotationDeclaration < Test::Unit::TestCase
private private
def xml(internal_subset) def xml(internal_subset)
@ -95,3 +96,4 @@ class TestParseNotationDeclaration < Test::Unit::TestCase
end end
end end
end end
end

Просмотреть файл

@ -2,6 +2,7 @@ require "test/unit"
require "rexml/parsers/sax2parser" require "rexml/parsers/sax2parser"
require "rexml/sax2listener" require "rexml/sax2listener"
module REXML
class TestSAX2Parser < Test::Unit::TestCase class TestSAX2Parser < Test::Unit::TestCase
class TestDocumentTypeDeclaration < self class TestDocumentTypeDeclaration < self
private private
@ -198,3 +199,4 @@ class TestSAX2Parser < Test::Unit::TestCase
end end
end end
end end
end

Просмотреть файл

@ -2,6 +2,7 @@ require "test/unit"
require "rexml/document" require "rexml/document"
require "rexml/parsers/treeparser" require "rexml/parsers/treeparser"
module REXML
class TestTreeParser < Test::Unit::TestCase class TestTreeParser < Test::Unit::TestCase
class TestInvalid < self class TestInvalid < self
def test_unmatched_close_tag def test_unmatched_close_tag
@ -38,3 +39,4 @@ Last 80 unconsumed characters:
end end
end end
end end
end

Просмотреть файл

@ -1,6 +1,7 @@
require "test/unit" require "test/unit"
require "rexml/parsers/ultralightparser" require "rexml/parsers/ultralightparser"
module REXML
class TestUltraLightParser < Test::Unit::TestCase class TestUltraLightParser < Test::Unit::TestCase
class TestDocumentTypeDeclaration < self class TestDocumentTypeDeclaration < self
def test_entity_declaration def test_entity_declaration
@ -65,3 +66,4 @@ class TestUltraLightParser < Test::Unit::TestCase
end end
end end
end end
end

Просмотреть файл

@ -1,6 +1,7 @@
require 'test/unit/testcase' require 'test/unit/testcase'
require 'rexml/document' require 'rexml/document'
module REXML
class AttributesTester < Test::Unit::TestCase class AttributesTester < Test::Unit::TestCase
include REXML include REXML
def test_accessor def test_accessor
@ -218,3 +219,4 @@ XML
child.attributes.to_a.collect(&:to_string).sort) child.attributes.to_a.collect(&:to_string).sort)
end end
end end
end

Просмотреть файл

@ -1,6 +1,7 @@
require 'test/unit' require 'test/unit'
require 'rexml/document' require 'rexml/document'
module REXML
class TestAttributes < Test::Unit::TestCase class TestAttributes < Test::Unit::TestCase
def setup def setup
@ns_a = "urn:x-test:a" @ns_a = "urn:x-test:a"
@ -27,3 +28,4 @@ class TestAttributes < Test::Unit::TestCase
assert_equal("6", @attributes.get_attribute_ns(@ns_b, "f").value) assert_equal("6", @attributes.get_attribute_ns(@ns_b, "f").value)
end end
end end
end

Просмотреть файл

@ -2,7 +2,7 @@
require 'rexml/encoding' require 'rexml/encoding'
module REXML
class ChangingEncodings < Test::Unit::TestCase class ChangingEncodings < Test::Unit::TestCase
def initialize a def initialize a
@u = 'テスト ほげ ふが 美しい' @u = 'テスト ほげ ふが 美しい'
@ -41,3 +41,4 @@ class ChangingEncodings < Test::Unit::TestCase
#} #}
end end
end end
end

Просмотреть файл

@ -2,6 +2,7 @@ require "test/unit/testcase"
require 'rexml/document' require 'rexml/document'
module REXML
module REXMLTest module REXMLTest
class CommentTester < Test::Unit::TestCase class CommentTester < Test::Unit::TestCase
# Bug #5278 # Bug #5278
@ -23,3 +24,4 @@ module REXMLTest
end end
end end
end end
end

Просмотреть файл

@ -6,6 +6,7 @@ require "rexml/document"
require "rexml/parseexception" require "rexml/parseexception"
require "rexml/formatters/default" require "rexml/formatters/default"
module REXML
class ContribTester < Test::Unit::TestCase class ContribTester < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
include REXML include REXML
@ -579,3 +580,4 @@ EOL
end end
=end =end
end end
end

Просмотреть файл

@ -11,6 +11,7 @@ require "rexml/undefinednamespaceexception"
require_relative "listener" require_relative "listener"
module REXML
class Tester < Test::Unit::TestCase class Tester < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
include REXML include REXML
@ -1460,3 +1461,4 @@ ENDXML
REXML::Attribute.new(name, value) REXML::Attribute.new(name, value)
end end
end end
end

Просмотреть файл

@ -1,6 +1,7 @@
require 'test/unit' require 'test/unit'
require 'rexml/document' require 'rexml/document'
module REXML
class TestDocTypeAccessor < Test::Unit::TestCase class TestDocTypeAccessor < Test::Unit::TestCase
def setup def setup
@ -102,3 +103,4 @@ class TestNotationDeclSystem < Test::Unit::TestCase
REXML::NotationDecl.new(@name, "SYSTEM", id, nil) REXML::NotationDecl.new(@name, "SYSTEM", id, nil)
end end
end end
end

Просмотреть файл

@ -1,6 +1,7 @@
require 'test/unit/testcase' require 'test/unit/testcase'
require 'rexml/document' require 'rexml/document'
module REXML
class ElementsTester < Test::Unit::TestCase class ElementsTester < Test::Unit::TestCase
include REXML include REXML
def test_accessor def test_accessor
@ -114,3 +115,4 @@ class ElementsTester < Test::Unit::TestCase
assert_equal 6, r assert_equal 6, r
end end
end end
end

Просмотреть файл

@ -5,6 +5,7 @@ require_relative "rexml_test_utils"
require 'rexml/source' require 'rexml/source'
require 'rexml/document' require 'rexml/document'
module REXML
class EncodingTester < Test::Unit::TestCase class EncodingTester < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
include REXML include REXML
@ -92,3 +93,4 @@ class EncodingTester < Test::Unit::TestCase
assert( utf16[0].kind_of?(REXML::XMLDecl)) assert( utf16[0].kind_of?(REXML::XMLDecl))
end end
end end
end

Просмотреть файл

@ -4,6 +4,7 @@ require 'rexml/document'
require 'rexml/entity' require 'rexml/entity'
require 'rexml/source' require 'rexml/source'
module REXML
class EntityTester < Test::Unit::TestCase class EntityTester < Test::Unit::TestCase
def test_parse_general_decl def test_parse_general_decl
simple = "<!ENTITY foo 'bar'>" simple = "<!ENTITY foo 'bar'>"
@ -185,3 +186,4 @@ XML
entity_filter).to_s) entity_filter).to_s)
end end
end end
end

Просмотреть файл

@ -2,6 +2,7 @@ require "test/unit/testcase"
require "rexml/document" require "rexml/document"
module REXML
class FunctionsTester < Test::Unit::TestCase class FunctionsTester < Test::Unit::TestCase
include REXML include REXML
def test_functions def test_functions
@ -220,3 +221,4 @@ class FunctionsTester < Test::Unit::TestCase
assert_equal( [REXML::Comment.new("COMMENT A")], m ) assert_equal( [REXML::Comment.new("COMMENT A")], m )
end end
end end
end

Просмотреть файл

@ -2,6 +2,7 @@ require 'rexml/document'
require 'test/unit' require 'test/unit'
require 'rexml/functions' require 'rexml/functions'
module REXML
class TC_Rexml_Functions_Number < Test::Unit::TestCase class TC_Rexml_Functions_Number < Test::Unit::TestCase
def test_functions_number_int def test_functions_number_int
@ -30,3 +31,4 @@ class TC_Rexml_Functions_Number < Test::Unit::TestCase
# assert_equal(9.13E12, REXML::Functions::number(telem)) # assert_equal(9.13E12, REXML::Functions::number(telem))
#end #end
end end
end

Просмотреть файл

@ -6,6 +6,7 @@ require "rexml/xpath"
# Harness to test REXML's capabilities against the test suite from Jaxen # Harness to test REXML's capabilities against the test suite from Jaxen
# ryan.a.cox@gmail.com # ryan.a.cox@gmail.com
module REXML
class JaxenTester < Test::Unit::TestCase class JaxenTester < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
include REXML include REXML
@ -124,3 +125,4 @@ class JaxenTester < Test::Unit::TestCase
end end
end end
end

Просмотреть файл

@ -2,6 +2,7 @@ require_relative "rexml_test_utils"
require "rexml/light/node" require "rexml/light/node"
require "rexml/parsers/lightparser" require "rexml/parsers/lightparser"
module REXML
class LightTester < Test::Unit::TestCase class LightTester < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
include REXML::Light include REXML::Light
@ -102,3 +103,4 @@ class LightTester < Test::Unit::TestCase
end end
=end =end
end end
end

Просмотреть файл

@ -1,6 +1,7 @@
require_relative 'rexml_test_utils' require_relative 'rexml_test_utils'
require 'rexml/parsers/lightparser' require 'rexml/parsers/lightparser'
module REXML
class LightParserTester < Test::Unit::TestCase class LightParserTester < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
include REXML include REXML
@ -10,3 +11,4 @@ class LightParserTester < Test::Unit::TestCase
parser.parse parser.parse
end end
end end
end

Просмотреть файл

@ -5,6 +5,7 @@ require_relative 'rexml_test_utils'
require 'rexml/document' require 'rexml/document'
require 'rexml/streamlistener' require 'rexml/streamlistener'
module REXML
class BaseTester < Test::Unit::TestCase class BaseTester < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
def test_empty def test_empty
@ -127,3 +128,4 @@ class REXMLTester < BaseTester
assert_equal( t6.strip, REXML::Document.new(t6).to_s ) assert_equal( t6.strip, REXML::Document.new(t6).to_s )
end end
end end
end

Просмотреть файл

@ -1,6 +1,7 @@
require 'test/unit' require 'test/unit'
require 'rexml/document' require 'rexml/document'
module REXML
class OrderTester < Test::Unit::TestCase class OrderTester < Test::Unit::TestCase
DOC = <<END DOC = <<END
<paper> <paper>
@ -35,3 +36,4 @@ END
assert_equal 'fig4', @figs[3].attributes['src'] assert_equal 'fig4', @figs[3].attributes['src']
end end
end end
end

Просмотреть файл

@ -2,6 +2,7 @@ require_relative "rexml_test_utils"
require "rexml/document" require "rexml/document"
module REXML
class TestNamespace < Test::Unit::TestCase class TestNamespace < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
include REXML include REXML
@ -36,3 +37,4 @@ XML
document.root.namespace("xml")) document.root.namespace("xml"))
end end
end end
end

Просмотреть файл

@ -5,6 +5,7 @@ begin
rescue LoadError rescue LoadError
end end
module REXML
class OrderTester < Test::Unit::TestCase class OrderTester < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
@ -103,3 +104,4 @@ END
} }
end if defined?(Zlib::GzipReader) end if defined?(Zlib::GzipReader)
end end
end

Просмотреть файл

@ -2,6 +2,7 @@
require 'test/unit' require 'test/unit'
require 'rexml/document' require 'rexml/document'
module REXML
# daz - for report by Dan Kohn in: # daz - for report by Dan Kohn in:
# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/156328 # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/156328
class XPathTesterDd < Test::Unit::TestCase class XPathTesterDd < Test::Unit::TestCase
@ -36,3 +37,4 @@ class XPathTesterDd < Test::Unit::TestCase
assert_equal( "<b x='ab01A'><c y='abc01A'>Success</c></b>", arr.join ) assert_equal( "<b x='ab01A'><c y='abc01A'>Success</c></b>", arr.join )
end end
end end
end

Просмотреть файл

@ -2,6 +2,7 @@ require "test/unit/testcase"
require 'rexml/parsers/pullparser' require 'rexml/parsers/pullparser'
module REXML
class PullParserTester < Test::Unit::TestCase class PullParserTester < Test::Unit::TestCase
include REXML include REXML
def test_basics def test_basics
@ -98,3 +99,4 @@ class PullParserTester < Test::Unit::TestCase
assert_equal( 0, names.length ) assert_equal( 0, names.length )
end end
end end
end

Просмотреть файл

@ -1,6 +1,7 @@
require_relative 'rexml_test_utils' require_relative 'rexml_test_utils'
require 'rexml/document' require 'rexml/document'
module REXML
class TestIssuezillaParsing < Test::Unit::TestCase class TestIssuezillaParsing < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
def test_rexml def test_rexml
@ -12,3 +13,4 @@ class TestIssuezillaParsing < Test::Unit::TestCase
end end
end end
end end
end

Просмотреть файл

@ -3,6 +3,7 @@ require 'rexml/sax2listener'
require 'rexml/parsers/sax2parser' require 'rexml/parsers/sax2parser'
require 'rexml/document' require 'rexml/document'
module REXML
class SAX2Tester < Test::Unit::TestCase class SAX2Tester < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
include REXML include REXML
@ -276,4 +277,4 @@ end
class MySAX2Listener class MySAX2Listener
include REXML::SAX2Listener include REXML::SAX2Listener
end end
end

Просмотреть файл

@ -3,6 +3,7 @@ require "rexml/document"
require 'rexml/streamlistener' require 'rexml/streamlistener'
require 'stringio' require 'stringio'
module REXML
class MyListener class MyListener
include REXML::StreamListener include REXML::StreamListener
end end
@ -125,3 +126,4 @@ class RequestReader
def doctype_end def doctype_end
end end
end end
end

Просмотреть файл

@ -1,5 +1,6 @@
require "rexml/text" require "rexml/text"
module REXML
class TextTester < Test::Unit::TestCase class TextTester < Test::Unit::TestCase
include REXML include REXML
@ -17,3 +18,4 @@ class TextTester < Test::Unit::TestCase
assert_equal("original\nappend1\nappend2\nappend3\nappend4\n", text.to_s) assert_equal("original\nappend1\nappend2\nappend3\nappend4\n", text.to_s)
end end
end end
end

Просмотреть файл

@ -9,6 +9,7 @@
require 'test/unit' require 'test/unit'
require 'rexml/document' require 'rexml/document'
module REXML
class Ticket80 < Test::Unit::TestCase class Ticket80 < Test::Unit::TestCase
@@xmlstr = '<?xml version="1.0"?> @@xmlstr = '<?xml version="1.0"?>
@ -50,6 +51,7 @@ class Ticket80 < Test::Unit::TestCase
end end
end end
end
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# end of rexml_test.rb # end of rexml_test.rb

Просмотреть файл

@ -3,6 +3,7 @@ require "test/unit/testcase"
require "rexml/document" require "rexml/document"
require "rexml/validation/relaxng" require "rexml/validation/relaxng"
module REXML
class RNGValidation < Test::Unit::TestCase class RNGValidation < Test::Unit::TestCase
include REXML include REXML
@ -788,3 +789,4 @@ class RNGValidation < Test::Unit::TestCase
assert_nothing_raised { parser.parse } assert_nothing_raised { parser.parse }
end end
end end
end

Просмотреть файл

@ -6,6 +6,7 @@
require "rexml/document" require "rexml/document"
require "test/unit" require "test/unit"
module REXML
class TestXmlDeclaration < Test::Unit::TestCase class TestXmlDeclaration < Test::Unit::TestCase
def setup def setup
xml = <<-'END_XML' xml = <<-'END_XML'
@ -31,3 +32,4 @@ class TestXmlDeclaration < Test::Unit::TestCase
assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling) assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling)
end end
end end
end

Просмотреть файл

@ -1,6 +1,7 @@
require 'test/unit' require 'test/unit'
require 'rexml/document' require 'rexml/document'
module REXML
class TestXPathAttribute < Test::Unit::TestCase class TestXPathAttribute < Test::Unit::TestCase
def setup def setup
@xml = <<-XML @xml = <<-XML
@ -25,3 +26,4 @@ class TestXPathAttribute < Test::Unit::TestCase
assert_equal(["child2"], children.collect(&:text)) assert_equal(["child2"], children.collect(&:text))
end end
end end
end

Просмотреть файл

@ -1,6 +1,7 @@
require "test/unit/testcase" require "test/unit/testcase"
require "rexml/document" require "rexml/document"
module REXML
class TestXPathAxisPredcedingSibling < Test::Unit::TestCase class TestXPathAxisPredcedingSibling < Test::Unit::TestCase
include REXML include REXML
SOURCE = <<-EOF SOURCE = <<-EOF
@ -35,4 +36,4 @@ class TestXPathAxisPredcedingSibling < Test::Unit::TestCase
assert_equal "3", prev.attributes["id"] assert_equal "3", prev.attributes["id"]
end end
end end
end

Просмотреть файл

@ -2,6 +2,7 @@ require_relative "../rexml_test_utils"
require "rexml/document" require "rexml/document"
module REXML
class TestXPathBase < Test::Unit::TestCase class TestXPathBase < Test::Unit::TestCase
include REXMLTestUtils include REXMLTestUtils
include REXML include REXML
@ -1077,3 +1078,4 @@ EOF
assert_equal(["/"], hrefs, "Bug #3842 [ruby-core:32447]") assert_equal(["/"], hrefs, "Bug #3842 [ruby-core:32447]")
end end
end end
end

Просмотреть файл

@ -4,6 +4,7 @@ require_relative "../rexml_test_utils"
require "rexml/document" require "rexml/document"
module REXML
class TestXPathNode < Test::Unit::TestCase class TestXPathNode < Test::Unit::TestCase
def matches(xml, xpath) def matches(xml, xpath)
document = REXML::Document.new(xml) document = REXML::Document.new(xml)
@ -38,3 +39,4 @@ class TestXPathNode < Test::Unit::TestCase
end end
end end
end end
end

Просмотреть файл

@ -3,6 +3,7 @@ require "rexml/document"
require "rexml/xpath" require "rexml/xpath"
require "rexml/parsers/xpathparser" require "rexml/parsers/xpathparser"
module REXML
class TestXPathPredicate < Test::Unit::TestCase class TestXPathPredicate < Test::Unit::TestCase
include REXML include REXML
SRC=<<-EOL SRC=<<-EOL
@ -78,3 +79,4 @@ XML
m ) m )
end end
end end
end

Просмотреть файл

@ -3,6 +3,7 @@ require 'rexml/document'
require 'rexml/element' require 'rexml/element'
require 'rexml/xpath' require 'rexml/xpath'
module REXML
class TestXPathText < Test::Unit::TestCase class TestXPathText < Test::Unit::TestCase
def setup def setup
@doc = REXML::Document.new @doc = REXML::Document.new
@ -70,3 +71,4 @@ class TestXPathText < Test::Unit::TestCase
assert nodes[1].kind_of?(REXML::Document) assert nodes[1].kind_of?(REXML::Document)
end end
end end
end