Sha256: 1ab4e02d33900ba2424857267aba7e7d0b6dbf012a87280045a7b21d2c5089d9

Contents?: true

Size: 754 Bytes

Versions: 34

Compression:

Stored size: 754 Bytes

Contents

#frozen_string_literal = true

package_require('ree_logger/appenders/rollbar_appender')

RSpec.describe ReeLogger::RollbarAppender do
  let(:rollbar_appender) { described_class }

  let(:log_event) {
    ReeLogger::LogEvent.new(
      :info,
      "Some message",
      nil,
      {}
    )
  }

  # comment "before" block to test sending to api
  before do
    allow(Rollbar).to receive(:log)
  end

  it "sends log event to Rollbar" do
    appender = rollbar_appender.new(
      :info,
      access_token: ENV['LOG_ROLLBAR_ACCESS_TOKEN'],
      environment: ENV['LOG_ROLLBAR_ENVIRONMENT']
    )

    expect(appender).to respond_to(:append)
    expect { appender.append(log_event) }.not_to raise_error
    expect(Rollbar).to have_received(:log)
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
ree_lib-1.0.39 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.38 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.37 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.36 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.35 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.34 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.33 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.32 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.31 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.30 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.29 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.28 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.27 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.26 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.24 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.23 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.22 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.21 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.20 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb
ree_lib-1.0.19 lib/ree_lib/packages/ree_logger/spec/ree_logger/appenders/rollbar_appender_spec.rb