Sha256: f34fc1dad07dd02882b91ebb59ccdb28004ed5603016d175f8ebbf81314b7574

Contents?: true

Size: 1.15 KB

Versions: 36

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe SimpleDeploy do

  before do
    @logger_mock = mock 'logger'
  end

  context "with new logger" do
    before do
      @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.should_receive(:new).with(STDOUT).and_return @logger_mock
    end

    it "should create a new logger object when one is not passed" do
      @logger = SimpleDeploy::SimpleDeployLogger.new
      @logger_mock.should_receive(:info).with 'a message'
      @logger.info 'a message'
    end

    it "accept puts with msg and pass it to debug" do
      @logger = SimpleDeploy::SimpleDeployLogger.new
      @logger_mock.should_receive(:debug).with 'a message'
      @logger.puts 'a message'
    end

    it "tty? return false" do
      @logger = SimpleDeploy::SimpleDeployLogger.new
      @logger.tty?.should be_false
    end
  end

  it "should create a new logger object from the hash passed as :logger" do
    Logger.should_receive(:new).exactly(0).times
    @logger = SimpleDeploy::SimpleDeployLogger.new :logger => @logger_mock
  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
simple_deploy-0.10.2 spec/logger_spec.rb
simple_deploy-0.10.1 spec/logger_spec.rb
simple_deploy-0.10.0 spec/logger_spec.rb
simple_deploy-0.10.0.beta.3 spec/logger_spec.rb
simple_deploy-0.10.0.beta.2 spec/logger_spec.rb
simple_deploy-0.10.0.beta.1 spec/logger_spec.rb
simple_deploy-0.9.2 spec/logger_spec.rb
simple_deploy-0.9.1 spec/logger_spec.rb
simple_deploy-0.9.0 spec/logger_spec.rb
simple_deploy-0.8.2 spec/logger_spec.rb
simple_deploy-0.8.2.beta1 spec/logger_spec.rb
simple_deploy-0.8.1.beta1 spec/logger_spec.rb
simple_deploy-0.8.0 spec/logger_spec.rb
simple_deploy-0.7.8 spec/logger_spec.rb
simple_deploy-0.7.7 spec/logger_spec.rb
simple_deploy-0.7.7.beta.1 spec/logger_spec.rb
simple_deploy-0.7.6 spec/logger_spec.rb
simple_deploy-0.7.6.beta.6 spec/logger_spec.rb
simple_deploy-0.7.6.beta.5 spec/logger_spec.rb
simple_deploy-0.7.6.beta.3 spec/logger_spec.rb