summaryrefslogtreecommitdiff
path: root/test/uri/test_ftp.rb
diff options
context:
space:
mode:
authorakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-05 06:09:26 +0000
committerakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-05 06:09:26 +0000
commit12c8c18f096722f5497f054edcf6c24435c5f879 (patch)
treea95120f82eaed9613c0404f5fd56b81cc21e3fd6 /test/uri/test_ftp.rb
parent16658578a55558271c76f305e62f526e6296c8e3 (diff)
* test/uri/*: translated RUNIT to Test::Unit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri/test_ftp.rb')
-rw-r--r--test/uri/test_ftp.rb43
1 files changed, 12 insertions, 31 deletions
diff --git a/test/uri/test_ftp.rb b/test/uri/test_ftp.rb
index 123eb22..a7b59ef 100644
--- a/test/uri/test_ftp.rb
+++ b/test/uri/test_ftp.rb
@@ -1,24 +1,10 @@
-#
-# $Id$
-#
-# Copyright (c) 2001 akira yamada <akira@ruby-lang.org>
-# You can redistribute it and/or modify it under the same term as Ruby.
-#
-
-require 'runit/testcase'
-require 'runit/testsuite'
-require 'runit/cui/testrunner'
-
+require 'test/unit'
require 'uri/ftp'
+
module URI
- class Generic
- def to_ary
- component_ary
- end
- end
-end
-class TestFTP < RUNIT::TestCase
+
+class TestFTP < Test::Unit::TestCase
def setup
end
@@ -31,7 +17,10 @@ class TestFTP < RUNIT::TestCase
'user:pass', 'host.com', URI::FTP.default_port,
'/abc/def', nil,
]
- ary = url.to_ary
+ ary = [
+ url.scheme, url.userinfo, url.host, url.port,
+ url.path, url.opaque
+ ]
assert_equal(exp, ary)
assert_equal('user', url.user)
@@ -41,21 +30,13 @@ class TestFTP < RUNIT::TestCase
def test_select
assert_equal(['ftp', 'a.b.c', 21], URI.parse('ftp://a.b.c/').select(:scheme, :host, :port))
u = URI.parse('ftp://a.b.c/')
- assert_equal(u.to_ary, u.select(*u.component))
- assert_exception(ArgumentError) do
+ ary = u.component.collect {|c| u.send(c)}
+ assert_equal(ary, u.select(*u.component))
+ assert_raises(ArgumentError) do
u.select(:scheme, :host, :not_exist, :port)
end
end
end
-if $0 == __FILE__
- if ARGV.size == 0
- suite = TestFTP.suite
- else
- suite = RUNIT::TestSuite.new
- ARGV.each do |testmethod|
- suite.add_test(TestFTP.new(testmethod))
- end
- end
- RUNIT::CUI::TestRunner.run(suite)
+
end