Sha256: 394490ea51530dc8ac20c69dcb45dc55b1a4e5a72803337241c035d808ff31af

Contents?: true

Size: 547 Bytes

Versions: 9

Compression:

Stored size: 547 Bytes

Contents

require 'test_helper'

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

9 entries across 9 versions & 1 rubygems

Version Path
cliutils-2.1.4 test/logger_extensions_test.rb
cliutils-2.1.3 test/logger_extensions_test.rb
cliutils-2.1.2 test/logger_extensions_test.rb
cliutils-2.1.1 test/logger_extensions_test.rb
cliutils-2.1.0 test/logger_extensions_test.rb
cliutils-2.0.3 test/logger_extensions_test.rb
cliutils-2.0.2 test/logger_extensions_test.rb
cliutils-2.0.1 test/logger_extensions_test.rb
cliutils-2.0.0 test/logger_extensions_test.rb