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_ldap.rb | |
parent | 16658578a55558271c76f305e62f526e6296c8e3 (diff) | |
download | ruby-12c8c18f096722f5497f054edcf6c24435c5f879.tar.gz |
* 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_ldap.rb')
-rw-r--r-- | test/uri/test_ldap.rb | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/test/uri/test_ldap.rb b/test/uri/test_ldap.rb index df55f6490b..866b7d8066 100644 --- a/test/uri/test_ldap.rb +++ b/test/uri/test_ldap.rb @@ -1,29 +1,20 @@ -# -# $Id$ -# -# Copyright (c) 2001 Takaaki Tateishi <ttate@jaist.ac.jp> and -# 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/cui/testrunner' +require 'test/unit' require 'uri/ldap' + module URI - class Generic - def to_ary - component_ary - end - end -end -class TestLDAP < RUNIT::TestCase + +class TestLDAP < 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 url = 'ldap://ldap.jaist.ac.jp/o=JAIST,c=JP?sn?base?(sn=ttate*)' u = URI.parse(url) @@ -92,27 +83,18 @@ class TestLDAP < RUNIT::TestCase nil, 'sub', nil, '!bindname=cn=Manager%2co=Foo'], }.each do |url, ary| u = URI.parse(url) - assert_equal(ary, u.to_ary) + assert_equal(ary, uri_to_ary(u)) end end def test_select u = URI.parse('ldap:///??sub??!bindname=cn=Manager%2co=Foo') - 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 = TestLDAP.suite - else - suite = RUNIT::TestSuite.new - ARGV.each do |testmethod| - suite.add_test(TestLDAP.new(testmethod)) - end - end - RUNIT::CUI::TestRunner.run(suite) + end |