diff options
author | akira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-05 06:09:26 +0000 |
---|---|---|
committer | akira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-05 06:09:26 +0000 |
commit | 12c8c18f096722f5497f054edcf6c24435c5f879 (patch) | |
tree | a95120f82eaed9613c0404f5fd56b81cc21e3fd6 /test/uri/test_http.rb | |
parent | 16658578a55558271c76f305e62f526e6296c8e3 (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_http.rb')
-rw-r--r-- | test/uri/test_http.rb | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/test/uri/test_http.rb b/test/uri/test_http.rb index 65fc2ef630..a6846141df 100644 --- a/test/uri/test_http.rb +++ b/test/uri/test_http.rb @@ -1,27 +1,26 @@ -require 'runit/testcase' -require 'runit/cui/testrunner' +require 'test/unit' require 'uri/http' + module URI - class Generic - def to_ary - component_ary - end - end -end -class TestHTTP < RUNIT::TestCase + +class TestHTTP < Test::Unit::TestCase def setup end def teardown end + def uri_to_ary(uri) + uri.class.component.collect {|c| uri.send(c)} + end + def test_parse u = URI.parse('http://a') assert_kind_of(URI::HTTP, u) assert_equal(['http', nil, 'a', URI::HTTP.default_port, - '', nil, nil], u.to_ary) + '', nil, nil], uri_to_ary(u)) end def test_normalize @@ -53,21 +52,12 @@ class TestHTTP < RUNIT::TestCase def test_select assert_equal(['http', 'a.b.c', 80], URI.parse('http://a.b.c/').select(:scheme, :host, :port)) u = URI.parse('http://a.b.c/') - assert_equal(u.to_ary, u.select(*u.component)) - assert_exception(ArgumentError) do + assert_equal(uri_to_ary(u), 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 = TestHTTP.suite - else - suite = RUNIT::TestSuite.new - ARGV.each do |testmethod| - suite.add_test(TestHTTP.new(testmethod)) - end - end - RUNIT::CUI::TestRunner.run(suite) + end |