Sha256: 037a1ab37a20f6a8c4c24f6687d1385698f48386319399d99d2f3275340557ba

Contents?: true

Size: 823 Bytes

Versions: 26

Compression:

Stored size: 823 Bytes

Contents

describe Bisu::Logger do
  let(:summary) { Bisu::Logger.summary }
  let(:info)    { summary[:info] }
  let(:warn)    { summary[:warn] }
  let(:error)   { summary[:error] }

  context "when logging to info" do
    before { Bisu::Logger.info "msg" }

    it "returns the expected totals" do
      expect(info).to  eq 1
      expect(warn).to  eq 0
      expect(error).to eq 0
    end
  end

  context "when logging to warn" do
    before { Bisu::Logger.warn "msg" }

    it "returns the expected totals" do
      expect(info).to  eq 0
      expect(warn).to  eq 1
      expect(error).to eq 0
    end
  end

  context "when logging to error" do
    before { Bisu::Logger.error "msg" }

    it "returns the expected totals" do
      expect(info).to  eq 0
      expect(warn).to  eq 0
      expect(error).to eq 1
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
bisu-1.4.2 spec/lib/bisu/logger_spec.rb
bisu-1.4.1 spec/lib/bisu/logger_spec.rb
bisu-1.4.0 spec/lib/bisu/logger_spec.rb
bisu-1.3.1 spec/lib/bisu/logger_spec.rb
bisu-1.3.0 spec/lib/bisu/logger_spec.rb
bisu-1.2.4 spec/bisu/logger_spec.rb