diff options
Diffstat (limited to 'test/util/log.rb')
-rwxr-xr-x | test/util/log.rb | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/test/util/log.rb b/test/util/log.rb index b28d601e9..5fb30cf05 100755 --- a/test/util/log.rb +++ b/test/util/log.rb @@ -35,9 +35,12 @@ class TestLog < Test::Unit::TestCase levels.collect { |level| next if level == :alert assert_nothing_raised() { - Puppet::Util::Log.new( + + Puppet::Util::Log.new( + :level => level, :source => "Test", + :message => "Unit test for %s" % level ) } @@ -118,8 +121,11 @@ class TestLog < Test::Unit::TestCase Puppet::Util::Log.newdestination :syslog assert_nothing_raised { - Puppet::Util::Log.new( + + Puppet::Util::Log.new( + :level => :info, + :message => "A message with %s in it" ) } @@ -128,8 +134,11 @@ class TestLog < Test::Unit::TestCase # Verify that the error and source are always strings def test_argsAreStrings msg = nil - file = Puppet::Type.type(:file).new( + + file = Puppet::Type.type(:file).new( + :path => tempfile(), + :check => %w{owner group} ) assert_nothing_raised { @@ -169,11 +178,9 @@ class TestLog < Test::Unit::TestCase Puppet::Util::Log.close(:console) Puppet::Util::Log.newdestination(file) Puppet.warning "A test" - assert(File.read(file) !~ /A test/, - "File defualted to autoflush") + assert(File.read(file) !~ /A test/, "File defualted to autoflush") Puppet::Util::Log.flush - assert(File.read(file) =~ /A test/, - "File did not flush") + assert(File.read(file) =~ /A test/, "File did not flush") Puppet::Util::Log.close(file) # Now try one with autoflush enabled @@ -181,8 +188,7 @@ class TestLog < Test::Unit::TestCase file = tempfile Puppet::Util::Log.newdestination(file) Puppet.warning "A test" - assert(File.read(file) =~ /A test/, - "File did not autoflush") + assert(File.read(file) =~ /A test/, "File did not autoflush") Puppet::Util::Log.close(file) end @@ -206,8 +212,7 @@ class TestLog < Test::Unit::TestCase # Now reopen the log Puppet::Util::Log.reopen Puppet.warning "Reopen test" - assert(File.read(file) =~ /Reopen test/, - "File did not reopen") + assert(File.read(file) =~ /Reopen test/, "File did not reopen") Puppet::Util::Log.close(file) end end |