Sha256: 495d89de9a00ecf7176257859c03e0f8ac8de448fa6878044de6e5f8bf1b106b

Contents?: true

Size: 713 Bytes

Versions: 2

Compression:

Stored size: 713 Bytes

Contents

require 'spec_helper'

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

  describe "with a Logger" do
    let(:logfile) { Tempfile.new(File.basename(__FILE__)) }
    let(:log)     { Gom::Logger.new logfile.path }

    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

2 entries across 2 versions & 1 rubygems

Version Path
gom-core-0.2.4 spec/gom/logger_spec.rb
gom-core-0.2.3 spec/gom/logger_spec.rb