Sha256: 4afc2696eb7dc6a88a41b734f3154ad16028bdb039842f3ec1e4db2bda03ba3d

Contents?: true

Size: 671 Bytes

Versions: 6

Compression:

Stored size: 671 Bytes

Contents

# coding: utf-8

class TestNephosServerLogger < Test::Unit::TestCase

  FILE = "/tmp/nephos_test_#{Time.now}.log"

  def test_basic
    fd = File.open(FILE, "w")
    Nephos::Logger.fd = fd
    Nephos::Logger.write "coucou"
    assert_equal("coucou\n", File.read(FILE))
    File.delete FILE

    fd = File.open(FILE, "w")
    Nephos::Logger.fd = fd
    Nephos::Logger.write %w(hello wôrld)
    assert_equal("hello\nwôrld\n", File.read(FILE))
    File.delete FILE
  end

  def test_basic_shortcut
    fd = File.open(FILE, "w")
    Nephos::Logger.fd = fd
    Nephos.log %w(hello wôrld)
    assert_equal("hello\nwôrld\n", File.read(FILE))
    File.delete FILE
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nephos-server-0.7.2 test/logger.rb
nephos-server-0.7.1 test/logger.rb
nephos-server-0.7.0 test/logger.rb
nephos-server-0.6.9 test/logger.rb
nephos-server-0.6.8 test/logger.rb
nephos-server-0.6.7 test/logger.rb