summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--ext/syslog/test.rb28
2 files changed, 18 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 229566b7e1..b411cdc665 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Nov 27 16:11:53 2002 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/syslog/test.rb: Switch from RUnit to Test::Unit.
+
+ * ext/syslog/test.rb: The output format of inspect() is slightly
+ altered.
+
Wed Nov 27 06:43:26 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* error.c (exit_initialize): add SystemExit#initialize to set
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