Sha256: 4a7be39b12f2b0a0492ab9f81448da648542bb965ccef3c3d2059d280040d676

Contents?: true

Size: 545 Bytes

Versions: 11

Compression:

Stored size: 545 Bytes

Contents

require 'test/unit'

require File.join(File.dirname(__FILE__), '..', 'lib/cliutils/ext/logger_extensions')

# Tests for the Logger extension methods
class TestLoggerExtensions < Test::Unit::TestCase
  def test_custom_level
    l = Logger.new(STDOUT)
    l.formatter = proc do |severity, datetime, progname, msg|
      puts "#{ severity }: #{ msg }"
    end

    assert_output("PROMPT: test\n")  { l.prompt('test')  }
    assert_output("SECTION: test\n") { l.section('test') }
    assert_output("SUCCESS: test\n") { l.success('test') }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cliutils-1.4.2 test/logger_extensions_test.rb
cliutils-1.4.1 test/logger_extensions_test.rb
cliutils-1.4.0 test/logger_extensions_test.rb
cliutils-1.3.1 test/logger_extensions_test.rb
cliutils-1.3.0 test/logger_extensions_test.rb
cliutils-1.2.9 test/logger_extensions_test.rb
cliutils-1.2.8 test/logger_extensions_test.rb
cliutils-1.2.7 test/logger_extensions_test.rb
cliutils-1.2.6 test/logger_extensions_test.rb
cliutils-1.2.5 test/logger_extensions_test.rb
cliutils-1.2.4 test/logger_extensions_test.rb