File: test_string_io.rb

package info (click to toggle)
ruby-logging 2.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 660 kB
  • sloc: ruby: 6,139; sh: 11; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

require File.expand_path('../setup', File.dirname(__FILE__))

module TestLogging
module TestAppenders

  class TestStringIO < Test::Unit::TestCase
    include LoggingTestCase

    def setup
      super

      @appender = Logging.appenders.string_io('test_appender')
      @sio = @appender.sio
      @levels = Logging::LEVELS
    end

    def teardown
      @appender.close
      @appender = nil
      super
    end

    def test_reopen
      assert_equal @sio.object_id, @appender.sio.object_id

      @appender.reopen
      assert @sio.closed?, 'StringIO instance is closed'
      assert_not_equal @sio.object_id, @appender.sio.object_id
    end

  end  # class TestStringIO

end  # module TestAppenders
end  # module TestLogging