Sha256: dcb827d19aecb0d6892c573c160fcb2fcd8e93baed557e39ae18695eb6e19e5b

Contents?: true

Size: 1.23 KB

Versions: 10

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

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

  it "accept puts with msg and pass it to debug" do
    logger_mock = mock 'logger'
    Logger.should_receive(:new).with(STDOUT).and_return logger_mock
    logger_mock.should_receive(:debug).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 = SimpleDeploy::SimpleDeployLogger.new
    logger.puts 'a message'
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
simple_deploy-0.5.6 spec/logger_spec.rb
simple_deploy-0.5.5 spec/logger_spec.rb
simple_deploy-0.5.4 spec/logger_spec.rb
simple_deploy-0.5.3 spec/logger_spec.rb
simple_deploy-0.5.2 spec/logger_spec.rb
simple_deploy-0.5.1 spec/logger_spec.rb
simple_deploy-0.5.0 spec/logger_spec.rb
simple_deploy-0.4.8 spec/logger_spec.rb
simple_deploy-0.4.7 spec/logger_spec.rb
simple_deploy-0.4.6 spec/logger_spec.rb