File: airbrake_spec.rb

package info (click to toggle)
ruby-uniform-notifier 1.16.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 240 kB
  • sloc: ruby: 915; makefile: 4
file content (27 lines) | stat: -rw-r--r-- 836 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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