mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-09 01:18:39 +03:00
1033d12040
--enable-testing.
27 lines
463 B
Ruby
27 lines
463 B
Ruby
require 'test/unit'
|
|
require 'stringio'
|
|
require 'log'
|
|
|
|
class TestLog < Test::Unit::TestCase
|
|
include Log
|
|
|
|
private
|
|
def remove_timestamps(l)
|
|
l.gsub(/\[[^\]]*\]/, '')
|
|
end
|
|
|
|
public
|
|
def test_log
|
|
StringIO.open do |out|
|
|
init(out)
|
|
|
|
info("msg1")
|
|
warning("msg2")
|
|
debug("msg3")
|
|
|
|
assert_equal("I, INFO -- : msg1\nW, WARN -- : msg2\nD, DEBUG -- : msg3\n",
|
|
remove_timestamps(out.string))
|
|
end
|
|
end
|
|
end
|