Sha256: 609b38e7f592fcafb19c9e0319fe2e8d7037ed8041ba9e4128b6e5800d3c0167

Contents?: true

Size: 1009 Bytes

Versions: 25

Compression:

Stored size: 1009 Bytes

Contents

require 'spec_helper'
require 'honeybadger/rails'

describe Honeybadger::Rails do
  include DefinesConstants

  it "triggers use of Rails' logger if logger isn't set and Rails' logger exists" do
    rails = Module.new do
      def self.logger
        "RAILS LOGGER"
      end
    end
    define_constant("Rails", rails)
    Honeybadger::Rails.initialize
    expect(Honeybadger.logger).to eq "RAILS LOGGER"
  end

  it "triggers use of Rails' default logger if logger isn't set and Rails.logger doesn't exist" do
    define_constant("RAILS_DEFAULT_LOGGER", "RAILS DEFAULT LOGGER")

    Honeybadger::Rails.initialize
    expect(Honeybadger.logger).to eq "RAILS DEFAULT LOGGER"
  end

  it "allows overriding of the logger if already assigned" do
    define_constant("RAILS_DEFAULT_LOGGER", "RAILS DEFAULT LOGGER")
    Honeybadger::Rails.initialize

    Honeybadger.configure(true) do |config|
      config.logger = "OVERRIDDEN LOGGER"
    end

    expect(Honeybadger.logger).to eq "OVERRIDDEN LOGGER"
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
honeybadger-1.13.2 spec/honeybadger/rails_spec.rb
honeybadger-1.13.1 spec/honeybadger/rails_spec.rb
honeybadger-1.13.0 spec/honeybadger/rails_spec.rb
honeybadger-1.11.2 spec/honeybadger/rails_spec.rb
honeybadger-1.11.1 spec/honeybadger/rails_spec.rb
honeybadger-1.11.0 spec/honeybadger/rails_spec.rb
honeybadger-1.10.3 spec/honeybadger/rails_spec.rb
honeybadger-1.11.0.beta4 spec/honeybadger/rails_spec.rb
honeybadger-1.11.0.beta3 spec/honeybadger/rails_spec.rb
honeybadger-1.11.0.beta2 spec/honeybadger/rails_spec.rb
honeybadger-1.10.2 spec/honeybadger/rails_spec.rb
honeybadger-1.11.0.beta1 spec/honeybadger/rails_spec.rb
honeybadger-1.10.1 spec/honeybadger/rails_spec.rb
honeybadger-1.10.0 spec/honeybadger/rails_spec.rb
honeybadger-1.9.5 spec/honeybadger/rails_spec.rb
honeybadger-1.10.0.beta2 spec/honeybadger/rails_spec.rb
honeybadger-1.10.0.beta1 spec/honeybadger/rails_spec.rb
honeybadger-1.9.4 spec/honeybadger/rails_spec.rb
honeybadger-1.9.3 spec/honeybadger/rails_spec.rb
honeybadger-1.9.2 spec/honeybadger/rails_spec.rb