Sha256: 35fe75e7956ea9888a0eadf636b8dd225ce1474157fbaa8e3ac48b443e041f1a

Contents?: true

Size: 922 Bytes

Versions: 4

Compression:

Stored size: 922 Bytes

Contents

require 'spec_helper'
require 'sneakers'
require 'logger'


class Foobar
  include Sneakers::Concerns::Logging
end

describe Sneakers::Concerns::Logging do
  describe ".configure" do
    before do
      Foobar.logger = nil
    end

    it "should configure a default logger when included" do
      _(Foobar.logger).must_be_nil
      Foobar.configure_logger
      _(Foobar.logger).wont_be_nil
      _(Foobar.logger.formatter).must_equal Sneakers::Support::ProductionFormatter
    end

    it "should supply accessible instance logger" do
      _(Foobar.logger).must_be_nil
      Foobar.configure_logger
      f = Foobar.new
      _(f.logger).must_equal Foobar.logger
      _(f.logger).wont_be_nil
    end

    it "should configure a given logger when specified" do
      _(Foobar.logger).must_be_nil
      log = Logger.new(STDOUT)
      Foobar.configure_logger(log)
      _(Foobar.logger).must_equal log
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kicks-3.1.1 spec/sneakers/concerns/logging_spec.rb
kicks-3.1.0 spec/sneakers/concerns/logging_spec.rb
kicks-3.0.0 spec/sneakers/concerns/logging_spec.rb
kicks-3.0.0.pre spec/sneakers/concerns/logging_spec.rb