Sha256: d2d73e73057c2dde48c08a1518fe5e2324c7e2fa03067244c8d91ab8d71a3433

Contents?: true

Size: 836 Bytes

Versions: 1

Compression:

Stored size: 836 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

class Airbrake
  # mock Airbrake
end

RSpec.describe UniformNotifier::AirbrakeNotifier do
  it 'should not notify airbrake' do
    expect(UniformNotifier::AirbrakeNotifier.out_of_channel_notify(title: 'notify airbrake')).to be_nil
  end

  it 'should notify airbrake' do
    expect(Airbrake).to receive(:notify).with(UniformNotifier::Exception.new('notify airbrake'), {})

    UniformNotifier.airbrake = true
    UniformNotifier::AirbrakeNotifier.out_of_channel_notify(title: 'notify airbrake')
  end

  it 'should notify airbrake' do
    expect(Airbrake).to receive(:notify).with(UniformNotifier::Exception.new('notify airbrake'), { foo: :bar })

    UniformNotifier.airbrake = { foo: :bar }
    UniformNotifier::AirbrakeNotifier.out_of_channel_notify('notify airbrake')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
uniform_notifier-1.16.0 spec/uniform_notifier/airbrake_spec.rb