Sha256: 18b48f8ec3b3a5778fdb761f3b99b3c2a4998eb0c5fda31b94d9483740e7a0ad

Contents?: true

Size: 779 Bytes

Versions: 31

Compression:

Stored size: 779 Bytes

Contents

require 'spec_helper'

describe Heirloom do

  it "should create a new logger object from the hash passed as :logger" do
    logger_mock = mock 'logger'
    logger_mock.should_receive(:info).with 'a message'
    logger = Heirloom::HeirloomLogger.new :logger => logger_mock
    logger.info 'a message'
  end

  it "should create a new logger object when one is not passed" do
    logger_mock = mock 'logger'
    Logger.should_receive(:new).with(STDOUT).and_return logger_mock
    logger_mock.should_receive(:info).with 'a message'
    logger_mock.should_receive(:datetime_format=).with '%Y-%m-%dT%H:%M:%S%z'
    logger_mock.should_receive(:formatter=)
    logger_mock.should_receive(:level=).with 1
    logger = Heirloom::HeirloomLogger.new
    logger.info 'a message'
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
heirloom-0.11.0 spec/logger_spec.rb
heirloom-0.11.0.beta.2 spec/logger_spec.rb
heirloom-0.11.0.beta.1 spec/logger_spec.rb
heirloom-0.10.1 spec/logger_spec.rb
heirloom-0.10.0 spec/logger_spec.rb
heirloom-0.9.0 spec/logger_spec.rb
heirloom-0.8.3 spec/logger_spec.rb
heirloom-0.8.2 spec/logger_spec.rb
heirloom-0.8.1 spec/logger_spec.rb
heirloom-0.8.0 spec/logger_spec.rb
heirloom-0.7.4 spec/logger_spec.rb
heirloom-0.7.3 spec/logger_spec.rb
heirloom-0.7.3rc2 spec/logger_spec.rb
heirloom-0.7.3rc1 spec/logger_spec.rb
heirloom-0.7.2 spec/logger_spec.rb
heirloom-0.7.2rc2 spec/logger_spec.rb
heirloom-0.7.2rc1 spec/logger_spec.rb
heirloom-0.7.1 spec/logger_spec.rb
heirloom-0.7.0 spec/logger_spec.rb
heirloom-0.7.0rc1 spec/logger_spec.rb