test/appenders/test_io.rb in logging-1.4.3 vs test/appenders/test_io.rb in logging-1.5.0

- old
+ new

@@ -1,7 +1,7 @@ -require File.join(File.dirname(__FILE__), %w[.. setup]) +require File.expand_path('../setup', File.dirname(__FILE__)) module TestLogging module TestAppenders class TestIO < Test::Unit::TestCase @@ -101,15 +101,14 @@ assert_equal false, @appender.closed? assert_equal 5, @appender.level end def test_flush - ary = [] - @sio.instance_variable_set :@ary, ary - def @sio.flush() @ary << :flush end + @appender.buffer << 'flush' + assert_nil @appender.readline @appender.flush - assert_equal :flush, ary.pop + assert_equal 'flush', @appender.readline end def test_initialize assert_raise(EOFError) {@sio.readline} assert_raise(TypeError) {Logging.appenders.io('test', [])}