summaryrefslogtreecommitdiff
path: root/test/xmlrpc
diff options
context:
space:
mode:
authormneumann <mneumann@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-16 10:55:47 +0000
committermneumann <mneumann@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-16 10:55:47 +0000
commitf5c2af51db6f330337f47a5bdbd95dfb72df4844 (patch)
tree90690ea6973779b8a9e009788e4a920b8b3331bb /test/xmlrpc
parentbefb362acf53b3ef725ead23d55edd24a0010cc4 (diff)
* fixed test cases so that they can be run from any directory
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/xmlrpc')
-rw-r--r--test/xmlrpc/test_datetime.rb1
-rw-r--r--test/xmlrpc/test_features.rb4
-rw-r--r--test/xmlrpc/test_marshal.rb1
-rw-r--r--test/xmlrpc/test_parser.rb31
4 files changed, 15 insertions, 22 deletions
diff --git a/test/xmlrpc/test_datetime.rb b/test/xmlrpc/test_datetime.rb
index d7fbb66..e38cea6 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 5984b97..273e0bc 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 5424628..38bc8c6 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 3665b6e..9c91d33 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 --------------------------------------------------