зеркало из https://github.com/github/ruby.git
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:
Родитель
1c35277c2b
Коммит
13a8d735d9
|
@ -1,6 +1,7 @@
|
|||
require "test/unit"
|
||||
require "rexml/document"
|
||||
|
||||
module REXML
|
||||
class TestParseDocumentTypeDeclaration < Test::Unit::TestCase
|
||||
private
|
||||
def xml(internal_subset)
|
||||
|
@ -45,3 +46,4 @@ class TestParseDocumentTypeDeclaration < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'test/unit'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
class TestParseNotationDeclaration < Test::Unit::TestCase
|
||||
private
|
||||
def xml(internal_subset)
|
||||
|
@ -95,3 +96,4 @@ class TestParseNotationDeclaration < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ require "test/unit"
|
|||
require "rexml/parsers/sax2parser"
|
||||
require "rexml/sax2listener"
|
||||
|
||||
module REXML
|
||||
class TestSAX2Parser < Test::Unit::TestCase
|
||||
class TestDocumentTypeDeclaration < self
|
||||
private
|
||||
|
@ -198,3 +199,4 @@ class TestSAX2Parser < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ require "test/unit"
|
|||
require "rexml/document"
|
||||
require "rexml/parsers/treeparser"
|
||||
|
||||
module REXML
|
||||
class TestTreeParser < Test::Unit::TestCase
|
||||
class TestInvalid < self
|
||||
def test_unmatched_close_tag
|
||||
|
@ -38,3 +39,4 @@ Last 80 unconsumed characters:
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require "test/unit"
|
||||
require "rexml/parsers/ultralightparser"
|
||||
|
||||
module REXML
|
||||
class TestUltraLightParser < Test::Unit::TestCase
|
||||
class TestDocumentTypeDeclaration < self
|
||||
def test_entity_declaration
|
||||
|
@ -65,3 +66,4 @@ class TestUltraLightParser < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'test/unit/testcase'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
class AttributesTester < Test::Unit::TestCase
|
||||
include REXML
|
||||
def test_accessor
|
||||
|
@ -218,3 +219,4 @@ XML
|
|||
child.attributes.to_a.collect(&:to_string).sort)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'test/unit'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
class TestAttributes < Test::Unit::TestCase
|
||||
def setup
|
||||
@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)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rexml/encoding'
|
||||
|
||||
|
||||
module REXML
|
||||
class ChangingEncodings < Test::Unit::TestCase
|
||||
def initialize a
|
||||
@u = 'テスト ほげ ふが 美しい'
|
||||
|
@ -41,3 +41,4 @@ class ChangingEncodings < Test::Unit::TestCase
|
|||
#}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ require "test/unit/testcase"
|
|||
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
module REXMLTest
|
||||
class CommentTester < Test::Unit::TestCase
|
||||
# Bug #5278
|
||||
|
@ -23,3 +24,4 @@ module REXMLTest
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,6 +6,7 @@ require "rexml/document"
|
|||
require "rexml/parseexception"
|
||||
require "rexml/formatters/default"
|
||||
|
||||
module REXML
|
||||
class ContribTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
@ -579,3 +580,4 @@ EOL
|
|||
end
|
||||
=end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,6 +11,7 @@ require "rexml/undefinednamespaceexception"
|
|||
|
||||
require_relative "listener"
|
||||
|
||||
module REXML
|
||||
class Tester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
@ -1460,3 +1461,4 @@ ENDXML
|
|||
REXML::Attribute.new(name, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'test/unit'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
class TestDocTypeAccessor < Test::Unit::TestCase
|
||||
|
||||
def setup
|
||||
|
@ -102,3 +103,4 @@ class TestNotationDeclSystem < Test::Unit::TestCase
|
|||
REXML::NotationDecl.new(@name, "SYSTEM", id, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'test/unit/testcase'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
class ElementsTester < Test::Unit::TestCase
|
||||
include REXML
|
||||
def test_accessor
|
||||
|
@ -114,3 +115,4 @@ class ElementsTester < Test::Unit::TestCase
|
|||
assert_equal 6, r
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,6 +5,7 @@ require_relative "rexml_test_utils"
|
|||
require 'rexml/source'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
class EncodingTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
@ -92,3 +93,4 @@ class EncodingTester < Test::Unit::TestCase
|
|||
assert( utf16[0].kind_of?(REXML::XMLDecl))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,6 +4,7 @@ require 'rexml/document'
|
|||
require 'rexml/entity'
|
||||
require 'rexml/source'
|
||||
|
||||
module REXML
|
||||
class EntityTester < Test::Unit::TestCase
|
||||
def test_parse_general_decl
|
||||
simple = "<!ENTITY foo 'bar'>"
|
||||
|
@ -185,3 +186,4 @@ XML
|
|||
entity_filter).to_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ require "test/unit/testcase"
|
|||
|
||||
require "rexml/document"
|
||||
|
||||
module REXML
|
||||
class FunctionsTester < Test::Unit::TestCase
|
||||
include REXML
|
||||
def test_functions
|
||||
|
@ -220,3 +221,4 @@ class FunctionsTester < Test::Unit::TestCase
|
|||
assert_equal( [REXML::Comment.new("COMMENT A")], m )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ require 'rexml/document'
|
|||
require 'test/unit'
|
||||
require 'rexml/functions'
|
||||
|
||||
module REXML
|
||||
class TC_Rexml_Functions_Number < Test::Unit::TestCase
|
||||
|
||||
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))
|
||||
#end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,6 +6,7 @@ require "rexml/xpath"
|
|||
# Harness to test REXML's capabilities against the test suite from Jaxen
|
||||
# ryan.a.cox@gmail.com
|
||||
|
||||
module REXML
|
||||
class JaxenTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
@ -124,3 +125,4 @@ class JaxenTester < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ require_relative "rexml_test_utils"
|
|||
require "rexml/light/node"
|
||||
require "rexml/parsers/lightparser"
|
||||
|
||||
module REXML
|
||||
class LightTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML::Light
|
||||
|
@ -102,3 +103,4 @@ class LightTester < Test::Unit::TestCase
|
|||
end
|
||||
=end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require_relative 'rexml_test_utils'
|
||||
require 'rexml/parsers/lightparser'
|
||||
|
||||
module REXML
|
||||
class LightParserTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
@ -10,3 +11,4 @@ class LightParserTester < Test::Unit::TestCase
|
|||
parser.parse
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,6 +5,7 @@ require_relative 'rexml_test_utils'
|
|||
require 'rexml/document'
|
||||
require 'rexml/streamlistener'
|
||||
|
||||
module REXML
|
||||
class BaseTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
def test_empty
|
||||
|
@ -127,3 +128,4 @@ class REXMLTester < BaseTester
|
|||
assert_equal( t6.strip, REXML::Document.new(t6).to_s )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'test/unit'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
class OrderTester < Test::Unit::TestCase
|
||||
DOC = <<END
|
||||
<paper>
|
||||
|
@ -35,3 +36,4 @@ END
|
|||
assert_equal 'fig4', @figs[3].attributes['src']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ require_relative "rexml_test_utils"
|
|||
|
||||
require "rexml/document"
|
||||
|
||||
module REXML
|
||||
class TestNamespace < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
@ -36,3 +37,4 @@ XML
|
|||
document.root.namespace("xml"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,6 +5,7 @@ begin
|
|||
rescue LoadError
|
||||
end
|
||||
|
||||
module REXML
|
||||
class OrderTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
|
||||
|
@ -103,3 +104,4 @@ END
|
|||
}
|
||||
end if defined?(Zlib::GzipReader)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
require 'test/unit'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
# daz - for report by Dan Kohn in:
|
||||
# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/156328
|
||||
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 )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ require "test/unit/testcase"
|
|||
|
||||
require 'rexml/parsers/pullparser'
|
||||
|
||||
module REXML
|
||||
class PullParserTester < Test::Unit::TestCase
|
||||
include REXML
|
||||
def test_basics
|
||||
|
@ -98,3 +99,4 @@ class PullParserTester < Test::Unit::TestCase
|
|||
assert_equal( 0, names.length )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require_relative 'rexml_test_utils'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
class TestIssuezillaParsing < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
def test_rexml
|
||||
|
@ -12,3 +13,4 @@ class TestIssuezillaParsing < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,6 +3,7 @@ require 'rexml/sax2listener'
|
|||
require 'rexml/parsers/sax2parser'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
class SAX2Tester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
@ -276,4 +277,4 @@ end
|
|||
class MySAX2Listener
|
||||
include REXML::SAX2Listener
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -3,6 +3,7 @@ require "rexml/document"
|
|||
require 'rexml/streamlistener'
|
||||
require 'stringio'
|
||||
|
||||
module REXML
|
||||
class MyListener
|
||||
include REXML::StreamListener
|
||||
end
|
||||
|
@ -125,3 +126,4 @@ class RequestReader
|
|||
def doctype_end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
require "rexml/text"
|
||||
|
||||
module REXML
|
||||
class TextTester < Test::Unit::TestCase
|
||||
include REXML
|
||||
|
||||
|
@ -17,3 +18,4 @@ class TextTester < Test::Unit::TestCase
|
|||
assert_equal("original\nappend1\nappend2\nappend3\nappend4\n", text.to_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
require 'test/unit'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
class Ticket80 < Test::Unit::TestCase
|
||||
|
||||
@@xmlstr = '<?xml version="1.0"?>
|
||||
|
@ -50,6 +51,7 @@ class Ticket80 < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# end of rexml_test.rb
|
||||
|
|
|
@ -3,6 +3,7 @@ require "test/unit/testcase"
|
|||
require "rexml/document"
|
||||
require "rexml/validation/relaxng"
|
||||
|
||||
module REXML
|
||||
class RNGValidation < Test::Unit::TestCase
|
||||
include REXML
|
||||
|
||||
|
@ -788,3 +789,4 @@ class RNGValidation < Test::Unit::TestCase
|
|||
assert_nothing_raised { parser.parse }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
require "rexml/document"
|
||||
require "test/unit"
|
||||
|
||||
module REXML
|
||||
class TestXmlDeclaration < Test::Unit::TestCase
|
||||
def setup
|
||||
xml = <<-'END_XML'
|
||||
|
@ -31,3 +32,4 @@ class TestXmlDeclaration < Test::Unit::TestCase
|
|||
assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'test/unit'
|
||||
require 'rexml/document'
|
||||
|
||||
module REXML
|
||||
class TestXPathAttribute < Test::Unit::TestCase
|
||||
def setup
|
||||
@xml = <<-XML
|
||||
|
@ -25,3 +26,4 @@ class TestXPathAttribute < Test::Unit::TestCase
|
|||
assert_equal(["child2"], children.collect(&:text))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require "test/unit/testcase"
|
||||
require "rexml/document"
|
||||
|
||||
module REXML
|
||||
class TestXPathAxisPredcedingSibling < Test::Unit::TestCase
|
||||
include REXML
|
||||
SOURCE = <<-EOF
|
||||
|
@ -35,4 +36,4 @@ class TestXPathAxisPredcedingSibling < Test::Unit::TestCase
|
|||
assert_equal "3", prev.attributes["id"]
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ require_relative "../rexml_test_utils"
|
|||
|
||||
require "rexml/document"
|
||||
|
||||
module REXML
|
||||
class TestXPathBase < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
@ -1077,3 +1078,4 @@ EOF
|
|||
assert_equal(["/"], hrefs, "Bug #3842 [ruby-core:32447]")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,6 +4,7 @@ require_relative "../rexml_test_utils"
|
|||
|
||||
require "rexml/document"
|
||||
|
||||
module REXML
|
||||
class TestXPathNode < Test::Unit::TestCase
|
||||
def matches(xml, xpath)
|
||||
document = REXML::Document.new(xml)
|
||||
|
@ -38,3 +39,4 @@ class TestXPathNode < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,6 +3,7 @@ require "rexml/document"
|
|||
require "rexml/xpath"
|
||||
require "rexml/parsers/xpathparser"
|
||||
|
||||
module REXML
|
||||
class TestXPathPredicate < Test::Unit::TestCase
|
||||
include REXML
|
||||
SRC=<<-EOL
|
||||
|
@ -78,3 +79,4 @@ XML
|
|||
m )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,6 +3,7 @@ require 'rexml/document'
|
|||
require 'rexml/element'
|
||||
require 'rexml/xpath'
|
||||
|
||||
module REXML
|
||||
class TestXPathText < Test::Unit::TestCase
|
||||
def setup
|
||||
@doc = REXML::Document.new
|
||||
|
@ -70,3 +71,4 @@ class TestXPathText < Test::Unit::TestCase
|
|||
assert nodes[1].kind_of?(REXML::Document)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче