Sha256: dd4d87c85b8b943289a94028a681f9bb6d1bc4328b44ffbe4466aed8cfaae66d

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 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 = Heirloom::HeirloomLogger.new
    logger.info 'a message'
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heirloom-0.1.4 spec/logger_spec.rb