diff options
-rw-r--r-- | test/xmlrpc/test_datetime.rb | 1 | ||||
-rw-r--r-- | test/xmlrpc/test_features.rb | 4 | ||||
-rw-r--r-- | test/xmlrpc/test_marshal.rb | 1 | ||||
-rw-r--r-- | test/xmlrpc/test_parser.rb | 31 |
4 files changed, 15 insertions, 22 deletions
diff --git a/test/xmlrpc/test_datetime.rb b/test/xmlrpc/test_datetime.rb index d7fbb6650..e38cea6f7 100644 --- a/test/xmlrpc/test_datetime.rb +++ b/test/xmlrpc/test_datetime.rb @@ -1,4 +1,3 @@ -$LOAD_PATH.unshift '../../lib' require 'test/unit' require "xmlrpc/datetime" diff --git a/test/xmlrpc/test_features.rb b/test/xmlrpc/test_features.rb index 5984b97a5..273e0bc4d 100644 --- a/test/xmlrpc/test_features.rb +++ b/test/xmlrpc/test_features.rb @@ -1,12 +1,8 @@ -$LOAD_PATH.unshift '../../lib' require 'test/unit' require "xmlrpc/create" require "xmlrpc/parser" require "xmlrpc/config" -#XMLRPC::Config.const_set(ENABLE_NIL_CREATE, true) -#XMLRPC::Config.const_set(ENABLE_NIL_PARSER, true) - class Test_Features < Test::Unit::TestCase def setup diff --git a/test/xmlrpc/test_marshal.rb b/test/xmlrpc/test_marshal.rb index 5424628d9..38bc8c646 100644 --- a/test/xmlrpc/test_marshal.rb +++ b/test/xmlrpc/test_marshal.rb @@ -1,4 +1,3 @@ -$LOAD_PATH.unshift '../../lib' require 'test/unit' require "xmlrpc/marshal" diff --git a/test/xmlrpc/test_parser.rb b/test/xmlrpc/test_parser.rb index 3665b6e1a..9c91d3348 100644 --- a/test/xmlrpc/test_parser.rb +++ b/test/xmlrpc/test_parser.rb @@ -1,29 +1,28 @@ -$LOAD_PATH.unshift '../../lib' require 'test/unit' require 'xmlrpc/datetime' require "xmlrpc/parser" module GenericParserTest - def setup - @xml1 = File.read("data/xml1.xml") - @expected1 = File.read("data/xml1.expected").chomp - - @xml2 = File.read("data/bug_covert.xml") - @expected2 = File.read("data/bug_covert.expected").chomp - - @xml3 = File.read("data/bug_bool.xml") - @expected3 = File.read("data/bug_bool.expected").chomp + def datafile(base) + File.join(File.dirname(__FILE__), "data", base) + end + + def load_data(name) + [File.read(datafile(name) + ".xml"), File.read(datafile(name) + ".expected").chomp] + end - @xml4 = File.read("data/value.xml") - @expected4 = File.read("data/value.expected").chomp + def setup + @xml1, @expected1 = load_data('xml1') + @xml2, @expected2 = load_data('bug_covert') + @xml3, @expected3 = load_data('bug_bool') + @xml4, @expected4 = load_data('value') - @cdata_xml = File.read("data/bug_cdata.xml").chomp - @cdata_expected = File.read("data/bug_cdata.expected").chomp + @cdata_xml, @cdata_expected = load_data('bug_cdata') - @datetime_xml = File.read("data/datetime_iso8601.xml") + @datetime_xml = File.read(datafile('datetime_iso8601.xml')) @datetime_expected = XMLRPC::DateTime.new(2004, 11, 5, 1, 15, 23) - @fault_doc = File.read("data/fault.xml").to_s + @fault_doc = File.read(datafile('fault.xml')) end # test parseMethodResponse -------------------------------------------------- |