M benchmarks/dash.xml => test/data/dash.xml +0 -0
M benchmarks/doctype_test.xml => test/data/doctype_test.xml +0 -0
M docs/documentation.xml => test/data/documentation.xml +0 -0
M benchmarks/project.xml => test/data/project.xml +0 -0
M docs/tutorial.xml => test/data/tutorial.xml +0 -0
M test/test_core.rb +8 -8
@@ 223,7 223,7 @@ class Tester < Test::Unit::TestCase
assert_equal(correct, test)
# OK, the BIG doctype test, numba wun
- docin = File.new "benchmarks/doctype_test.xml"
+ docin = File.new "test/data/doctype_test.xml"
doc = Document.new(docin)
doc.write(test="")
assert_equal(31, doc.doctype.size)
@@ 266,7 266,7 @@ class Tester < Test::Unit::TestCase
assert_instance_of DocType, doc.doctype
assert_equal doc.version, "1.0"
- source = File.new( "benchmarks/dash.xml" )
+ source = File.new( "test/data/dash.xml" )
doc = Document.new source
assert_equal "content-2", doc.elements["//content-2"].name
end
@@ 357,7 357,7 @@ class Tester < Test::Unit::TestCase
assert_equal doc.root.name.to_s, "xsa"
# Testing IO source
- doc = Document.new File.new("benchmarks/project.xml")
+ doc = Document.new File.new("test/data/project.xml")
assert_equal doc.root.name.to_s, "Project"
end
@@ 443,7 443,7 @@ class Tester < Test::Unit::TestCase
# enormous.
def test_element_access
# Testing each_element
- doc = Document.new File.new("benchmarks/project.xml")
+ doc = Document.new File.new("test/data/project.xml")
each_test( doc, "/", 1 ) { |child|
assert_equal doc.name, child.name
@@ 608,7 608,7 @@ class Tester < Test::Unit::TestCase
def test_big_documentation
- f = File.new("docs/documentation.xml")
+ f = File.new("test/data/documentation.xml")
d = Document.new f
assert_equal "Sean Russell", d.elements["documentation/head/author"].text.tr("\n\t", " ").squeeze(" ")
out = ""
@@ 616,14 616,14 @@ class Tester < Test::Unit::TestCase
end
def test_tutorial
- doc = Document.new File.new("docs/tutorial.xml")
+ doc = Document.new File.new("test/data/tutorial.xml")
out = ""
doc.write out
end
def test_stream
c = Listener.new
- Document.parse_stream( File.new("docs/documentation.xml"), c )
+ Document.parse_stream( File.new("test/data/documentation.xml"), c )
assert(c.ts, "Stream parsing apparantly didn't parse the whole file")
assert(c.te, "Stream parsing dropped end tag for documentation")
@@ 1051,7 1051,7 @@ EOL
def test_text_raw
# From the REXML tutorial
- # (http://www.germane-software.com/software/rexml/docs/tutorial.html)
+ # (http://www.germane-software.com/software/rexml/test/data/tutorial.html)
doc = Document.new <<-EOL
<?xml version="1.0"?>
<!DOCTYPE schema SYSTEM "XMLSchema.dtd" [
M test/test_light.rb +1 -1
@@ 6,7 6,7 @@ include REXML::Light
class LightTester < Test::Unit::TestCase
def test_parse_large
- parser = REXML::Parsers::LightParser.new( File.new( "docs/documentation.xml" ) )
+ parser = REXML::Parsers::LightParser.new( File.new( "test/data/documentation.xml" ) )
root = parser.parse
end
M test/test_lightparser.rb +1 -1
@@ 4,7 4,7 @@ require 'rexml/parsers/lightparser'
class LightParserTester < Test::Unit::TestCase
include REXML
def test_parsing
- f = File.new( "docs/documentation.xml" )
+ f = File.new( "test/data/documentation.xml" )
parser = REXML::Parsers::LightParser.new( f )
root = parser.parse
end
M test/test_sax.rb +1 -1
@@ 29,7 29,7 @@ class SAX2Tester < Test::Unit::TestCase
end
def test_sax2
- f = File.new("docs/documentation.xml")
+ f = File.new("test/data/documentation.xml")
parser = Parsers::SAX2Parser.new( f )
# Listen to all events on the following elements
count = 0
M test/test_xpath.rb +1 -1
@@ 128,7 128,7 @@ class XPathTester < Test::Unit::TestCase
assert_equal("b", XPath::first(c, "..").name)
assert_equal("a", XPath::first(@@doc, "a/b/..").name)
- doc = REXML::Document.new(File.new("benchmarks/project.xml"))
+ doc = REXML::Document.new(File.new("test/data/project.xml"))
c = each_test(doc.root, "./Description" ) { |child|
assert_equal("Description",child.name)
}