aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tsort.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-21 05:51:41 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-21 05:51:41 +0000
commitfce7467e601e76d64a175929f2f14f89cfd450dd (patch)
treeb12c0550733bcac2a76b583ff5fd88f60340ea92 /lib/tsort.rb
parentc2dbfe53fc1d34b3c38172bda2a801fc60f26e66 (diff)
downloadruby-fce7467e601e76d64a175929f2f14f89cfd450dd.tar.gz
* lib/pp.rb: Use Test::Unit.
* lib/prettyprint.rb: Ditto * lib/time.rb: Ditto * lib/tsort.rb: Ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tsort.rb')
-rw-r--r--lib/tsort.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/tsort.rb b/lib/tsort.rb
index 21adeaabfe..7832030792 100644
--- a/lib/tsort.rb
+++ b/lib/tsort.rb
@@ -245,8 +245,7 @@ module TSort
end
if __FILE__ == $0
- require 'runit/testcase'
- require 'runit/cui/testrunner'
+ require 'test/unit'
class Hash
include TSort
@@ -264,7 +263,7 @@ if __FILE__ == $0
end
end
- class TSortTest < RUNIT::TestCase
+ class TSortTest < Test::Unit::TestCase
def test_dag
h = {1=>[2, 3], 2=>[3], 3=>[]}
assert_equal([3, 2, 1], h.tsort)
@@ -275,7 +274,7 @@ if __FILE__ == $0
h = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
assert_equal([[4], [2, 3], [1]],
h.strongly_connected_components.map {|nodes| nodes.sort})
- assert_exception(TSort::Cyclic) { h.tsort }
+ assert_raises(TSort::Cyclic) { h.tsort }
end
def test_array
@@ -289,6 +288,5 @@ if __FILE__ == $0
end
end
- RUNIT::CUI::TestRunner.run(TSortTest.suite)
end