Sha256: f18c2069d671cc684b5a707ac398da47dee817a65eb1c5ef2c92e00016a69c5b

Contents?: true

Size: 685 Bytes

Versions: 140

Compression:

Stored size: 685 Bytes

Contents

describe Appsignal::Logger do
  let(:log) { std_stream }
  let(:logger) do
    Appsignal::Logger.new(log).tap do |l|
      l.formatter = logger_formatter
    end
  end

  describe "#seen_keys" do
    it "returns a Set" do
      expect(logger.seen_keys).to be_a(Set)
    end
  end

  describe "#warn_once_then_debug" do
    it "only warns once, then uses debug" do
      message = "This is a log line"
      3.times { logger.warn_once_then_debug(:key, message) }

      logs = log_contents(log)
      expect(logs.scan(/#{Regexp.escape(log_line(:WARN, message))}/).count).to eql(1)
      expect(logs.scan(/#{Regexp.escape(log_line(:DEBUG, message))}/).count).to eql(2)
    end
  end
end

Version data entries

140 entries across 140 versions & 1 rubygems

Version Path
appsignal-3.1.6-java spec/lib/appsignal/logger_spec.rb
appsignal-3.1.6 spec/lib/appsignal/logger_spec.rb
appsignal-3.1.5-java spec/lib/appsignal/logger_spec.rb
appsignal-3.1.5 spec/lib/appsignal/logger_spec.rb
appsignal-3.1.4-java spec/lib/appsignal/logger_spec.rb
appsignal-3.1.4 spec/lib/appsignal/logger_spec.rb
appsignal-3.1.3-java spec/lib/appsignal/logger_spec.rb
appsignal-3.1.3 spec/lib/appsignal/logger_spec.rb
appsignal-3.1.2-java spec/lib/appsignal/logger_spec.rb
appsignal-3.1.2 spec/lib/appsignal/logger_spec.rb
appsignal-3.1.1-java spec/lib/appsignal/logger_spec.rb
appsignal-3.1.1 spec/lib/appsignal/logger_spec.rb
appsignal-3.1.0-java spec/lib/appsignal/logger_spec.rb
appsignal-3.1.0 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.27-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.27 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.26-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.26 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.25-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.25 spec/lib/appsignal/logger_spec.rb