From 2c463325aeca51ed431f2dea9108f98c050b93f1 Mon Sep 17 00:00:00 2001 From: knu Date: Wed, 27 Nov 2002 07:14:00 +0000 Subject: * ext/syslog/test.rb: Switch from RUnit to Test::Unit. * ext/syslog/test.rb: The output format of inspect() is slightly altered. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/syslog/test.rb | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'ext/syslog') diff --git a/ext/syslog/test.rb b/ext/syslog/test.rb index 6cd861b2b2..ed5dd9d1b4 100644 --- a/ext/syslog/test.rb +++ b/ext/syslog/test.rb @@ -5,17 +5,16 @@ # Please only run this test on machines reasonable for testing. # If in doubt, ask your admin. -require 'runit/testcase' -require 'runit/cui/testrunner' +require 'test/unit' # Prepend current directory to load path for testing. $:.unshift('.') require 'syslog' -class TestSyslog < RUNIT::TestCase +class TestSyslog < Test::Unit::TestCase def test_new - assert_exception(NameError) { + assert_raises(NoMethodError) { Syslog.new } end @@ -41,7 +40,7 @@ class TestSyslog < RUNIT::TestCase assert_equal(Syslog::LOG_USER, Syslog.facility) # open without close - assert_exception(RuntimeError) { + assert_raises(RuntimeError) { Syslog.open } @@ -143,19 +142,14 @@ class TestSyslog < RUNIT::TestCase def test_inspect Syslog.open { |sl| - assert_equal(format('<#%s: opened=%s, ident="%s", ' + - 'options=%d, facility=%d, mask=%d>', - Syslog, sl.opened?, sl.ident, - sl.options, sl.facility, sl.mask), + assert_equal(format('<#%s: ident="%s", options=%d, facility=%d, mask=%d%s>', + Syslog, + sl.ident, + sl.options, + sl.facility, + sl.mask, + sl.opened? ? ', opened' : ''), sl.inspect) } end end - -if $0 == __FILE__ - suite = RUNIT::TestSuite.new - - suite.add_test(TestSyslog.suite) - - RUNIT::CUI::TestRunner.run(suite) -end -- cgit v1.2.3