Sha256: 75bca36155cdd88671681cec2ed82b89095156562c8b4dc80e357790aa6a9841

Contents?: true

Size: 594 Bytes

Versions: 12

Compression:

Stored size: 594 Bytes

Contents

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

12 entries across 12 versions & 2 rubygems

Version Path
gettalong-webgen-0.5.4.20080929 test/test_loggable.rb
gettalong-webgen-0.5.5.20081001 test/test_loggable.rb
gettalong-webgen-0.5.5.20081010 test/test_loggable.rb
gettalong-webgen-0.5.5.20081012 test/test_loggable.rb
gettalong-webgen-0.5.6.20081020 test/test_loggable.rb
webgen-0.5.0 test/test_loggable.rb
webgen-0.5.4 test/test_loggable.rb
webgen-0.5.1 test/test_loggable.rb
webgen-0.5.3 test/test_loggable.rb
webgen-0.5.2 test/test_loggable.rb
webgen-0.5.5 test/test_loggable.rb
webgen-0.5.6 test/test_loggable.rb