Sha256: 0b3231955a78d6f74434a6f6124181877d1d3b95b7848e2c984b436be7940af0

Contents?: true

Size: 621 Bytes

Versions: 15

Compression:

Stored size: 621 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'test/unit'
require 'helper'
require 'webgen/loggable'
require 'webgen/logger'
require 'stringio'

class TestLoggable < Test::Unit::TestCase

  include Test::WebsiteHelper

  def setup
    super
    @website.logger = Webgen::Logger.new(@io = StringIO.new, true)
    @obj = Object.new
    @obj.extend(Webgen::Loggable)
  end

  def test_log
    @obj.log(:error) { 'hallo' }
    assert_equal("ERROR -- hallo\n", @io.string)
  end

  def test_puts
    @obj.puts 'test'
    assert_equal("test\n", @io.string)
    @obj.puts 'test', :verbose
    assert_equal("test\n", @io.string)
  end

end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
gettalong-webgen-0.5.7.20090227 test/test_loggable.rb
gettalong-webgen-0.5.8.20090507 test/test_loggable.rb
gettalong-webgen-0.5.9.20090620 test/test_loggable.rb
gettalong-webgen-0.5.9.20090626 test/test_loggable.rb
thewoolleyman-webgen-0.5.8.20090419 test/test_loggable.rb
webgen-0.5.17 test/test_loggable.rb
webgen-0.5.15 test/test_loggable.rb
webgen-0.5.14 test/test_loggable.rb
webgen-0.5.13 test/test_loggable.rb
webgen-0.5.12 test/test_loggable.rb
webgen-0.5.11 test/test_loggable.rb
webgen-0.5.10 test/test_loggable.rb
webgen-0.5.9 test/test_loggable.rb
webgen-0.5.7 test/test_loggable.rb
webgen-0.5.8 test/test_loggable.rb