Sha256: d4af5c321b38134b4892400485fc9874f14bffa5c45e68247283721b81b1691f

Contents?: true

Size: 743 Bytes

Versions: 3

Compression:

Stored size: 743 Bytes

Contents

require "spec_helper"

describe Alephant::Logger::Base do
  describe "#info" do
    context "no logger drivers given" do
      subject { Alephant::Logger::Base.new [] }

      specify do
        expect_any_instance_of(::Logger).to receive(:info).with "msg"

        subject.info "msg"
      end
    end

    context "logger drivers given" do
      subject { Alephant::Logger::Base.new [driver] }

      let(:driver) { double }

      it "responding drivers receive method calls" do
        expect(driver).to receive(:metric).with("foo")

        subject.metric("foo")
      end

      it "::Logger is always used" do
        expect_any_instance_of(::Logger).to receive(:info).with "foo"

        subject.info "foo"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alephant-logger-1.2.1 spec/logger_base_spec.rb
alephant-logger-1.2.0 spec/logger_base_spec.rb
alephant-logger-1.1.1 spec/logger_base_spec.rb