summaryrefslogtreecommitdiff
path: root/test/syslog
diff options
context:
space:
mode:
Diffstat (limited to 'test/syslog')
-rw-r--r--test/syslog/test_syslog_logger.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/syslog/test_syslog_logger.rb b/test/syslog/test_syslog_logger.rb
index 0b6328443f..65b4a9437f 100644
--- a/test/syslog/test_syslog_logger.rb
+++ b/test/syslog/test_syslog_logger.rb
@@ -80,13 +80,12 @@ class TestSyslogRootLogger < Test::Unit::TestCase
end
def log_raw(msg_id, *arg, &block)
- logdev = Tempfile.new(File.basename(__FILE__) + '.log')
- @logger.instance_eval { @logdev = Logger::LogDevice.new(logdev) }
- assert_equal true, @logger.__send__(msg_id, *arg, &block)
- logdev.open
- msg = logdev.read
- logdev.close(true)
- msg
+ Tempfile.create(File.basename(__FILE__) + '.log') {|logdev|
+ @logger.instance_eval { @logdev = Logger::LogDevice.new(logdev) }
+ assert_equal true, @logger.__send__(msg_id, *arg, &block)
+ logdev.rewind
+ logdev.read
+ }
end
def test_initialize