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.6.1 spec/logger_spec.rb
heirloom-0.6.0rc1 spec/logger_spec.rb
heirloom-0.5.0rc4 spec/logger_spec.rb
heirloom-0.5.0rc3 spec/logger_spec.rb
heirloom-0.5.0rc2 spec/logger_spec.rb
heirloom-0.5.0rc1 spec/logger_spec.rb
heirloom-0.4.1rc1 spec/logger_spec.rb
heirloom-0.4.0 spec/logger_spec.rb
heirloom-0.3.1 spec/logger_spec.rb
heirloom-0.3.0 spec/logger_spec.rb
heirloom-0.3.0.rc1 spec/logger_spec.rb