Sha256: 2f8d370cbff8ad1ddbb738885f8855e5ce5c6479c3edd6533f0e47e824453d98

Contents?: true

Size: 743 Bytes

Versions: 26

Compression:

Stored size: 743 Bytes

Contents

require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')

class TestLog < Test::Unit::TestCase
  def test_get_level
    assert_equal 0, Log.get_level(:debug)
    assert_equal 1, Log.get_level(:low)
    assert_equal 1, Log.get_level("LOW")
    assert_equal 1, Log.get_level(1)
    assert_equal 0, Log.get_level(nil)
  end

  def test_color
    assert Log.color(:green, "green")
  end

  def test_iif
    TmpFile.with_file do |tmp|
      Log.logfile(tmp)
      iif :foo
      assert File.read(tmp).include? ":foo"
      assert File.read(tmp).include? "INFO"
    end
  end

  def test_tty_size
    assert Integer === Log.tty_size
  end

end


Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
scout-essentials-1.6.5 test/scout/test_log.rb
scout-essentials-1.6.4 test/scout/test_log.rb
scout-essentials-1.6.3 test/scout/test_log.rb
scout-essentials-1.6.2 test/scout/test_log.rb
scout-essentials-1.6.1 test/scout/test_log.rb
scout-essentials-1.6.0 test/scout/test_log.rb
scout-essentials-1.3.1 test/scout/test_log.rb
scout-essentials-1.3.0 test/scout/test_log.rb
scout-essentials-1.2.0 test/scout/test_log.rb
scout-essentials-1.1.1 test/scout/test_log.rb
scout-essentials-1.1.0 test/scout/test_log.rb
scout-essentials-1.0.0 test/scout/test_log.rb
scout-gear-9.1.0 test/scout/test_log.rb
scout-gear-9.0.0 test/scout/test_log.rb
scout-gear-8.1.0 test/scout/test_log.rb
scout-gear-8.0.0 test/scout/test_log.rb
scout-gear-7.3.0 test/scout/test_log.rb
scout-gear-7.2.0 test/scout/test_log.rb
scout-gear-7.1.0 test/scout/test_log.rb
scout-gear-6.0.0 test/scout/test_log.rb