mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/rexml/test_contrib.rb: Indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
313fa18033
commit
ba3d2f4ac2
36 changed files with 5153 additions and 5149 deletions
|
|
@ -1,3 +1,7 @@
|
|||
Tue May 27 22:10:30 2014 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* test/rexml/test_contrib.rb: Indent.
|
||||
|
||||
Tue May 27 21:28:16 2014 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* ext/socket/ifaddr.c (ifaddr_inspect_flags): support IFF_SIMPLEX.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require "test/unit"
|
|||
require "rexml/document"
|
||||
|
||||
module REXMLTests
|
||||
class TestParseDocumentTypeDeclaration < Test::Unit::TestCase
|
||||
class TestParseDocumentTypeDeclaration < Test::Unit::TestCase
|
||||
private
|
||||
def xml(internal_subset)
|
||||
<<-XML
|
||||
|
|
@ -45,5 +45,5 @@ class TestParseDocumentTypeDeclaration < Test::Unit::TestCase
|
|||
doctype.children.collect(&:class))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test/unit'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
class TestParseNotationDeclaration < Test::Unit::TestCase
|
||||
class TestParseNotationDeclaration < Test::Unit::TestCase
|
||||
private
|
||||
def xml(internal_subset)
|
||||
<<-XML
|
||||
|
|
@ -95,5 +95,5 @@ class TestParseNotationDeclaration < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test/unit/testcase'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
class AttributesTester < Test::Unit::TestCase
|
||||
class AttributesTester < Test::Unit::TestCase
|
||||
include REXML
|
||||
def test_accessor
|
||||
doc = Document.new("<a xmlns:foo='a' xmlns:bar='b' foo:att='1' bar:att='2' att='3'/>")
|
||||
|
|
@ -218,5 +218,5 @@ XML
|
|||
],
|
||||
child.attributes.to_a.collect(&:to_string).sort)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test/unit'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
class TestAttributes < Test::Unit::TestCase
|
||||
class TestAttributes < Test::Unit::TestCase
|
||||
def setup
|
||||
@ns_a = "urn:x-test:a"
|
||||
@ns_b = "urn:x-test:b"
|
||||
|
|
@ -27,5 +27,5 @@ class TestAttributes < Test::Unit::TestCase
|
|||
assert_equal("5", @attributes.get_attribute_ns(@ns_a, "e").value)
|
||||
assert_equal("6", @attributes.get_attribute_ns(@ns_b, "f").value)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
require 'rexml/encoding'
|
||||
|
||||
module REXMLTests
|
||||
class ChangingEncodings < Test::Unit::TestCase
|
||||
class ChangingEncodings < Test::Unit::TestCase
|
||||
def initialize a
|
||||
@u = 'テスト ほげ ふが 美しい'
|
||||
@e = @u.encode("EUC-JP")
|
||||
|
|
@ -40,5 +40,5 @@ class ChangingEncodings < Test::Unit::TestCase
|
|||
# @f.decode(@u) == @u
|
||||
#}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ require "rexml/parseexception"
|
|||
require "rexml/formatters/default"
|
||||
|
||||
module REXMLTests
|
||||
class ContribTester < Test::Unit::TestCase
|
||||
class ContribTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
||||
|
|
@ -561,7 +561,7 @@ EOL
|
|||
def test_namespace_serialization_tobi_reif
|
||||
doc = Document.new '<doc xmlns:b="http://www.foo.foo">
|
||||
<b:p/>
|
||||
</doc>'
|
||||
</doc>'
|
||||
ns = 'http://www.foo.foo'
|
||||
ns_declaration={'f'=>ns}
|
||||
returned = XPath.match(doc,'//f:p',ns_declaration)
|
||||
|
|
@ -579,5 +579,5 @@ EOL
|
|||
# 'namespace should still be "http://www.foo.foo" and not ""'
|
||||
end
|
||||
=end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ require "rexml/undefinednamespaceexception"
|
|||
require_relative "listener"
|
||||
|
||||
module REXMLTests
|
||||
class Tester < Test::Unit::TestCase
|
||||
class Tester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
def setup
|
||||
|
|
@ -1460,5 +1460,5 @@ ENDXML
|
|||
def attribute(name, value)
|
||||
REXML::Attribute.new(name, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test/unit'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
class TestDocTypeAccessor < Test::Unit::TestCase
|
||||
class TestDocTypeAccessor < Test::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@sysid = "urn:x-test:sysid1"
|
||||
|
|
@ -62,9 +62,9 @@ class TestDocTypeAccessor < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
class TestNotationDeclPublic < Test::Unit::TestCase
|
||||
class TestNotationDeclPublic < Test::Unit::TestCase
|
||||
def setup
|
||||
@name = "vrml"
|
||||
@id = "VRML 1.0"
|
||||
|
|
@ -85,9 +85,9 @@ class TestNotationDeclPublic < Test::Unit::TestCase
|
|||
def decl(id, uri)
|
||||
REXML::NotationDecl.new(@name, "PUBLIC", id, uri)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class TestNotationDeclSystem < Test::Unit::TestCase
|
||||
class TestNotationDeclSystem < Test::Unit::TestCase
|
||||
def setup
|
||||
@name = "gif"
|
||||
@id = "gif viewer"
|
||||
|
|
@ -102,5 +102,5 @@ class TestNotationDeclSystem < Test::Unit::TestCase
|
|||
def decl(id)
|
||||
REXML::NotationDecl.new(@name, "SYSTEM", id, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test/unit/testcase'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
class ElementsTester < Test::Unit::TestCase
|
||||
class ElementsTester < Test::Unit::TestCase
|
||||
include REXML
|
||||
def test_accessor
|
||||
doc = Document.new '<a><b/><c id="1"/><c id="2"/><d/></a>'
|
||||
|
|
@ -114,5 +114,5 @@ class ElementsTester < Test::Unit::TestCase
|
|||
}
|
||||
assert_equal 6, r
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ require 'rexml/source'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
class EncodingTester < Test::Unit::TestCase
|
||||
class EncodingTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
||||
|
|
@ -92,5 +92,5 @@ class EncodingTester < Test::Unit::TestCase
|
|||
assert_equal(utf16.encoding, "UTF-16")
|
||||
assert( utf16[0].kind_of?(REXML::XMLDecl))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ require 'rexml/entity'
|
|||
require 'rexml/source'
|
||||
|
||||
module REXMLTests
|
||||
class EntityTester < Test::Unit::TestCase
|
||||
class EntityTester < Test::Unit::TestCase
|
||||
def test_parse_general_decl
|
||||
simple = "<!ENTITY foo 'bar'>"
|
||||
simple =~ /#{REXML::Entity::GEDECL}/
|
||||
|
|
@ -185,5 +185,5 @@ XML
|
|||
raw,
|
||||
entity_filter).to_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ require "test/unit/testcase"
|
|||
require "rexml/document"
|
||||
|
||||
module REXMLTests
|
||||
class FunctionsTester < Test::Unit::TestCase
|
||||
class FunctionsTester < Test::Unit::TestCase
|
||||
include REXML
|
||||
def test_functions
|
||||
# trivial text() test
|
||||
|
|
@ -220,5 +220,5 @@ class FunctionsTester < Test::Unit::TestCase
|
|||
m = REXML::XPath.match(doc, "//comment()[#{predicate}]")
|
||||
assert_equal( [REXML::Comment.new("COMMENT A")], m )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ require 'test/unit'
|
|||
require 'rexml/functions'
|
||||
|
||||
module REXMLTests
|
||||
class TC_Rexml_Functions_Number < Test::Unit::TestCase
|
||||
class TC_Rexml_Functions_Number < Test::Unit::TestCase
|
||||
|
||||
def test_functions_number_int
|
||||
telem = REXML::Element.new("elem")
|
||||
|
|
@ -30,5 +30,5 @@ class TC_Rexml_Functions_Number < Test::Unit::TestCase
|
|||
# telem.text="9.13E12"
|
||||
# assert_equal(9.13E12, REXML::Functions::number(telem))
|
||||
#end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ require "rexml/xpath"
|
|||
# ryan.a.cox@gmail.com
|
||||
|
||||
module REXMLTests
|
||||
class JaxenTester < Test::Unit::TestCase
|
||||
class JaxenTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
||||
|
|
@ -124,5 +124,5 @@ class JaxenTester < Test::Unit::TestCase
|
|||
namespaces[prefix] = ctx.namespaces[prefix]
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ require "rexml/light/node"
|
|||
require "rexml/parsers/lightparser"
|
||||
|
||||
module REXMLTests
|
||||
class LightTester < Test::Unit::TestCase
|
||||
class LightTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML::Light
|
||||
|
||||
|
|
@ -102,5 +102,5 @@ class LightTester < Test::Unit::TestCase
|
|||
r
|
||||
end
|
||||
=end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require_relative 'rexml_test_utils'
|
|||
require 'rexml/parsers/lightparser'
|
||||
|
||||
module REXMLTests
|
||||
class LightParserTester < Test::Unit::TestCase
|
||||
class LightParserTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
def test_parsing
|
||||
|
|
@ -10,5 +10,5 @@ class LightParserTester < Test::Unit::TestCase
|
|||
parser = REXML::Parsers::LightParser.new( f )
|
||||
parser.parse
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ require 'rexml/document'
|
|||
require 'rexml/streamlistener'
|
||||
|
||||
module REXMLTests
|
||||
class BaseTester < Test::Unit::TestCase
|
||||
class BaseTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
def test_empty
|
||||
return unless defined? @listener
|
||||
|
|
@ -98,9 +98,9 @@ class BaseTester < Test::Unit::TestCase
|
|||
AccentListener::new
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class MyREXMLListener
|
||||
class MyREXMLListener
|
||||
include REXML::StreamListener
|
||||
|
||||
def initialize
|
||||
|
|
@ -116,9 +116,9 @@ class MyREXMLListener
|
|||
def text( text )
|
||||
@text << text
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class REXMLTester < BaseTester
|
||||
class REXMLTester < BaseTester
|
||||
def setup
|
||||
@listener = MyREXMLListener.new
|
||||
end
|
||||
|
|
@ -127,5 +127,5 @@ class REXMLTester < BaseTester
|
|||
t6 = %Q{<string>
</string>}
|
||||
assert_equal( t6.strip, REXML::Document.new(t6).to_s )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test/unit'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
class OrderTester < Test::Unit::TestCase
|
||||
class OrderTester < Test::Unit::TestCase
|
||||
DOC = <<END
|
||||
<paper>
|
||||
<title>Remove this element and figs order differently</title>
|
||||
|
|
@ -35,5 +35,5 @@ END
|
|||
def test_fig4
|
||||
assert_equal 'fig4', @figs[3].attributes['src']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ require_relative "rexml_test_utils"
|
|||
require "rexml/document"
|
||||
|
||||
module REXMLTests
|
||||
class TestNamespace < Test::Unit::TestCase
|
||||
class TestNamespace < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
|
||||
|
|
@ -36,5 +36,5 @@ XML
|
|||
assert_equal("http://www.w3.org/XML/1998/namespace",
|
||||
document.root.namespace("xml"))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ rescue LoadError
|
|||
end
|
||||
|
||||
module REXMLTests
|
||||
class OrderTester < Test::Unit::TestCase
|
||||
class OrderTester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
|
||||
TESTDOC = <<END
|
||||
|
|
@ -103,5 +103,5 @@ END
|
|||
count += 1
|
||||
}
|
||||
end if defined?(Zlib::GzipReader)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ require 'test/unit'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
# 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
|
||||
# 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
|
||||
include REXML
|
||||
|
||||
def setup
|
||||
|
|
@ -36,5 +36,5 @@ class XPathTesterDd < Test::Unit::TestCase
|
|||
end
|
||||
assert_equal( "<b x='ab01A'><c y='abc01A'>Success</c></b>", arr.join )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ require "test/unit/testcase"
|
|||
require 'rexml/parsers/pullparser'
|
||||
|
||||
module REXMLTests
|
||||
class PullParserTester < Test::Unit::TestCase
|
||||
class PullParserTester < Test::Unit::TestCase
|
||||
include REXML
|
||||
def test_basics
|
||||
source = '<?xml version="1.0"?>
|
||||
|
|
@ -98,5 +98,5 @@ class PullParserTester < Test::Unit::TestCase
|
|||
end
|
||||
assert_equal( 0, names.length )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require_relative 'rexml_test_utils'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
class TestIssuezillaParsing < Test::Unit::TestCase
|
||||
class TestIssuezillaParsing < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
def test_rexml
|
||||
doc = REXML::Document.new(File.new(fixture_path("ofbiz-issues-full-177.xml")))
|
||||
|
|
@ -12,5 +12,5 @@ class TestIssuezillaParsing < Test::Unit::TestCase
|
|||
ctr += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ require 'rexml/parsers/sax2parser'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
class SAX2Tester < Test::Unit::TestCase
|
||||
class SAX2Tester < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
def test_characters
|
||||
|
|
@ -272,9 +272,9 @@ class SAX2Tester < Test::Unit::TestCase
|
|||
flunk $!.message
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class MySAX2Listener
|
||||
class MySAX2Listener
|
||||
include REXML::SAX2Listener
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ require 'rexml/streamlistener'
|
|||
require 'stringio'
|
||||
|
||||
module REXMLTests
|
||||
class MyListener
|
||||
class MyListener
|
||||
include REXML::StreamListener
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
class StreamTester < Test::Unit::TestCase
|
||||
class StreamTester < Test::Unit::TestCase
|
||||
# Submitted by Han Holl
|
||||
def test_listener
|
||||
data = %Q{<session1 user="han" password="rootWeiler" />\n<session2 user="han" password="rootWeiler" />}
|
||||
|
|
@ -87,11 +87,11 @@ class StreamTester < Test::Unit::TestCase
|
|||
|
||||
assert_equal(["ISOLat2"], listener.entities)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# For test_listener
|
||||
class RequestReader
|
||||
# For test_listener
|
||||
class RequestReader
|
||||
attr_reader :doc
|
||||
def initialize(io)
|
||||
@stack = []
|
||||
|
|
@ -125,5 +125,5 @@ class RequestReader
|
|||
end
|
||||
def doctype_end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
require "rexml/text"
|
||||
|
||||
module REXMLTests
|
||||
class TextTester < Test::Unit::TestCase
|
||||
class TextTester < Test::Unit::TestCase
|
||||
include REXML
|
||||
|
||||
def test_shift_operator_chain
|
||||
|
|
@ -17,5 +17,5 @@ class TextTester < Test::Unit::TestCase
|
|||
text << "append3\r\n" << "append4\r\n"
|
||||
assert_equal("original\nappend1\nappend2\nappend3\nappend4\n", text.to_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ require 'test/unit'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
class Ticket80 < Test::Unit::TestCase
|
||||
class Ticket80 < Test::Unit::TestCase
|
||||
|
||||
@@xmlstr = '<?xml version="1.0"?>
|
||||
<root xmlns="urn:some-xml-ns" xmlns:other="urn:some-other-xml-ns">
|
||||
|
|
@ -50,7 +50,7 @@ class Ticket80 < Test::Unit::TestCase
|
|||
assert_equal chk, out
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ require "rexml/document"
|
|||
require "rexml/validation/relaxng"
|
||||
|
||||
module REXMLTests
|
||||
class RNGValidation < Test::Unit::TestCase
|
||||
class RNGValidation < Test::Unit::TestCase
|
||||
include REXML
|
||||
|
||||
def test_validate
|
||||
|
|
@ -788,5 +788,5 @@ class RNGValidation < Test::Unit::TestCase
|
|||
parser.add_listener( validator.reset )
|
||||
assert_nothing_raised { parser.parse }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ require "rexml/document"
|
|||
require "test/unit"
|
||||
|
||||
module REXMLTests
|
||||
class TestXmlDeclaration < Test::Unit::TestCase
|
||||
class TestXmlDeclaration < Test::Unit::TestCase
|
||||
def setup
|
||||
xml = <<-'END_XML'
|
||||
<?xml encoding= 'UTF-8' standalone='yes'?>
|
||||
|
|
@ -31,5 +31,5 @@ class TestXmlDeclaration < Test::Unit::TestCase
|
|||
assert_kind_of(REXML::XMLDecl, @root.previous_sibling.previous_sibling)
|
||||
assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test/unit'
|
|||
require 'rexml/document'
|
||||
|
||||
module REXMLTests
|
||||
class TestXPathAttribute < Test::Unit::TestCase
|
||||
class TestXPathAttribute < Test::Unit::TestCase
|
||||
def setup
|
||||
@xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
|
@ -25,5 +25,5 @@ class TestXPathAttribute < Test::Unit::TestCase
|
|||
children = REXML::XPath.each(@document, "/root/child[@name='two']")
|
||||
assert_equal(["child2"], children.collect(&:text))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require "test/unit/testcase"
|
|||
require "rexml/document"
|
||||
|
||||
module REXMLTests
|
||||
class TestXPathAxisPredcedingSibling < Test::Unit::TestCase
|
||||
class TestXPathAxisPredcedingSibling < Test::Unit::TestCase
|
||||
include REXML
|
||||
SOURCE = <<-EOF
|
||||
<a id='1'>
|
||||
|
|
@ -35,5 +35,5 @@ class TestXPathAxisPredcedingSibling < Test::Unit::TestCase
|
|||
prev = XPath.first(context, "preceding-sibling::f[3]")
|
||||
assert_equal "3", prev.attributes["id"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ require_relative "../rexml_test_utils"
|
|||
require "rexml/document"
|
||||
|
||||
module REXMLTests
|
||||
class TestXPathBase < Test::Unit::TestCase
|
||||
class TestXPathBase < Test::Unit::TestCase
|
||||
include REXMLTestUtils
|
||||
include REXML
|
||||
SOURCE = <<-EOF
|
||||
|
|
@ -1077,5 +1077,5 @@ EOF
|
|||
end
|
||||
assert_equal(["/"], hrefs, "Bug #3842 [ruby-core:32447]")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ require_relative "../rexml_test_utils"
|
|||
require "rexml/document"
|
||||
|
||||
module REXMLTests
|
||||
class TestXPathNode < Test::Unit::TestCase
|
||||
class TestXPathNode < Test::Unit::TestCase
|
||||
def matches(xml, xpath)
|
||||
document = REXML::Document.new(xml)
|
||||
REXML::XPath.each(document, xpath).collect(&:to_s)
|
||||
|
|
@ -38,5 +38,5 @@ class TestXPathNode < Test::Unit::TestCase
|
|||
matches(xml, "/root/non-àscii/child"))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ require "rexml/xpath"
|
|||
require "rexml/parsers/xpathparser"
|
||||
|
||||
module REXMLTests
|
||||
class TestXPathPredicate < Test::Unit::TestCase
|
||||
class TestXPathPredicate < Test::Unit::TestCase
|
||||
include REXML
|
||||
SRC=<<-EOL
|
||||
<article>
|
||||
|
|
@ -78,5 +78,5 @@ XML
|
|||
REXML::Comment.new("COMMENT")],
|
||||
m )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ require 'rexml/element'
|
|||
require 'rexml/xpath'
|
||||
|
||||
module REXMLTests
|
||||
class TestXPathText < Test::Unit::TestCase
|
||||
class TestXPathText < Test::Unit::TestCase
|
||||
def setup
|
||||
@doc = REXML::Document.new
|
||||
end
|
||||
|
|
@ -70,5 +70,5 @@ class TestXPathText < Test::Unit::TestCase
|
|||
assert_equal(2, nodes.size, "<b> has two node ancestors")
|
||||
assert nodes[1].kind_of?(REXML::Document)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue