summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/xmlrpc/test_client.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/xmlrpc/test_client.rb b/test/xmlrpc/test_client.rb
index e12391a3ea..353bfc5f88 100644
--- a/test/xmlrpc/test_client.rb
+++ b/test/xmlrpc/test_client.rb
@@ -98,5 +98,39 @@ module XMLRPC
[ user, password, use_ssl, timeout ].each { |x| refute x }
end
+
+ def test_new2_no_path
+ client = FakeClient.new2 'http://example.org'
+ host, path, port, *rest = client.args
+
+ assert_equal 'example.org', host
+ assert_nil path
+ assert port
+
+ rest.each { |x| refute x }
+ end
+
+ def test_new2_slash_path
+ client = FakeClient.new2 'http://example.org/'
+ host, path, port, *rest = client.args
+
+ assert_equal 'example.org', host
+ assert_equal '/', path
+ assert port
+
+ rest.each { |x| refute x }
+ end
+
+ def test_new2_bad_protocol
+ assert_raises(ArgumentError) do
+ XMLRPC::Client.new2 'ftp://example.org'
+ end
+ end
+
+ def test_new2_bad_uri
+ assert_raises(ArgumentError) do
+ XMLRPC::Client.new2 ':::::'
+ end
+ end
end
end