* 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
This commit is contained in:
parent
31a57b49db
commit
2c463325ae
@ -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>
|
Wed Nov 27 06:43:26 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* error.c (exit_initialize): add SystemExit#initialize to set
|
* error.c (exit_initialize): add SystemExit#initialize to set
|
||||||
|
@ -5,17 +5,16 @@
|
|||||||
# Please only run this test on machines reasonable for testing.
|
# Please only run this test on machines reasonable for testing.
|
||||||
# If in doubt, ask your admin.
|
# If in doubt, ask your admin.
|
||||||
|
|
||||||
require 'runit/testcase'
|
require 'test/unit'
|
||||||
require 'runit/cui/testrunner'
|
|
||||||
|
|
||||||
# Prepend current directory to load path for testing.
|
# Prepend current directory to load path for testing.
|
||||||
$:.unshift('.')
|
$:.unshift('.')
|
||||||
|
|
||||||
require 'syslog'
|
require 'syslog'
|
||||||
|
|
||||||
class TestSyslog < RUNIT::TestCase
|
class TestSyslog < Test::Unit::TestCase
|
||||||
def test_new
|
def test_new
|
||||||
assert_exception(NameError) {
|
assert_raises(NoMethodError) {
|
||||||
Syslog.new
|
Syslog.new
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -41,7 +40,7 @@ class TestSyslog < RUNIT::TestCase
|
|||||||
assert_equal(Syslog::LOG_USER, Syslog.facility)
|
assert_equal(Syslog::LOG_USER, Syslog.facility)
|
||||||
|
|
||||||
# open without close
|
# open without close
|
||||||
assert_exception(RuntimeError) {
|
assert_raises(RuntimeError) {
|
||||||
Syslog.open
|
Syslog.open
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,19 +142,14 @@ class TestSyslog < RUNIT::TestCase
|
|||||||
|
|
||||||
def test_inspect
|
def test_inspect
|
||||||
Syslog.open { |sl|
|
Syslog.open { |sl|
|
||||||
assert_equal(format('<#%s: opened=%s, ident="%s", ' +
|
assert_equal(format('<#%s: ident="%s", options=%d, facility=%d, mask=%d%s>',
|
||||||
'options=%d, facility=%d, mask=%d>',
|
Syslog,
|
||||||
Syslog, sl.opened?, sl.ident,
|
sl.ident,
|
||||||
sl.options, sl.facility, sl.mask),
|
sl.options,
|
||||||
|
sl.facility,
|
||||||
|
sl.mask,
|
||||||
|
sl.opened? ? ', opened' : ''),
|
||||||
sl.inspect)
|
sl.inspect)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if $0 == __FILE__
|
|
||||||
suite = RUNIT::TestSuite.new
|
|
||||||
|
|
||||||
suite.add_test(TestSyslog.suite)
|
|
||||||
|
|
||||||
RUNIT::CUI::TestRunner.run(suite)
|
|
||||||
end
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user