summaryrefslogtreecommitdiff
path: root/ext/syslog
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-27 07:14:00 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-27 07:14:00 +0000
commit2c463325aeca51ed431f2dea9108f98c050b93f1 (patch)
treeb582f20ed4a76defa9f8e4a53c8a3247baf85a90 /ext/syslog
parent31a57b49dbe9859596a1f6b3d03e06b2a4858900 (diff)
* 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
Diffstat (limited to 'ext/syslog')
-rw-r--r--ext/syslog/test.rb28
1 files changed, 11 insertions, 17 deletions
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