Sha256: 8c147bf41c19a3645fe431be1b2162e123e1eb49c0ed8f5ebcbe8d2e99298005

Contents?: true

Size: 784 Bytes

Versions: 10

Compression:

Stored size: 784 Bytes

Contents

require 'spec_helper'

describe Stackster 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 = Stackster::StacksterLogger.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 = Stackster::StacksterLogger.new
    logger.info 'a message'
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
stackster-0.4.4 spec/logger_spec.rb
stackster-0.4.3 spec/logger_spec.rb
stackster-0.4.2 spec/logger_spec.rb
stackster-0.4.1 spec/logger_spec.rb
stackster-0.4.0 spec/logger_spec.rb
stackster-0.3.2 spec/logger_spec.rb
stackster-0.3.1 spec/logger_spec.rb
stackster-0.3.0 spec/logger_spec.rb
stackster-0.2.9 spec/logger_spec.rb
stackster-0.2.8 spec/logger_spec.rb