Sha256: d0f39feb72b43a3914e4081f6451e698ee01b8964c59016cc3cfbe7ac149c2fe

Contents?: true

Size: 830 Bytes

Versions: 7

Compression:

Stored size: 830 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

class TestLogging
  include Logging
end

describe Logging do
  before do
    Logging.silent = false
    @object = TestLogging.new
  end
  
  it "should output debug when set to true" do
    Logging.debug = true
    @object.should_receive(:puts)
    @object.debug 'hi'
  end

  it "should output trace when set to true" do
    Logging.trace = true
    @object.should_receive(:puts)
    @object.trace 'hi'
  end

  it "should not output when silenced" do
    Logging.silent = true
    @object.should_not_receive(:puts)
    @object.log 'hi'
  end
  
  it "should not output when silenced [deprecated]" do
    @object.should_receive(:warn)
    @object.silent = true
    
    @object.should_not_receive(:puts)
    @object.log 'hi'
  end
  
  after do
    Logging.silent = true
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
thin-0.7.0-x86-mswin32-60 spec/logging_spec.rb
thin-0.7.1-x86-mswin32-60 spec/logging_spec.rb
thin-0.8.1 spec/logging_spec.rb
thin-0.8.2 spec/logging_spec.rb
thin-0.7.0 spec/logging_spec.rb
thin-0.7.1 spec/logging_spec.rb
thin-0.8.0 spec/logging_spec.rb