Sha256: 67bb5c15c61888e207fe57453eaf3dd34b99c90711d4d9a74740726b3e8990a5

Contents?: true

Size: 765 Bytes

Versions: 1

Compression:

Stored size: 765 Bytes

Contents

require File.dirname(__FILE__)+'/../spec_helper'

describe Gom::Logger do
  it "should find the class" do
    Gom::Logger.should_not == nil
  end

  describe "with a Logger" do
    before :each do
      require 'tempfile'
      @logfile = Tempfile.new self
      @log = Gom::Logger.new @logfile.path
    end

    it "should have a default 'I' log level" do
      @log.info self.to_s
      (line = @logfile.read).should_not == nil
      line.should =~ / I #{self.to_s}/
    end

    it "should log execeptions" do
      raise "foo" rescue @log.ex $!, "bar"
      (txt = @logfile.read).should_not == nil

      #assert_match " E RuntimeError: bar", txt, @logfile.path
      txt.should =~ / E foo: bar/
      txt.should =~ / D foo -- callstack: bar/
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gom-core-0.1.1 spec/gom/logger_spec.rb