Sha256: 22084be2e752cb57a38e9d340211d5bc3ddd8f9a10eb8bfb73d5888c398593cd

Contents?: true

Size: 826 Bytes

Versions: 8

Compression:

Stored size: 826 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

class Rollbar
  # mock Rollbar
end

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

  it 'should notify rollbar' do
    expect(Rollbar).to receive(:log).with('info', UniformNotifier::Exception.new('notify rollbar'))

    UniformNotifier.rollbar = true
    UniformNotifier::RollbarNotifier.out_of_channel_notify(title: 'notify rollbar')
  end

  it 'should notify rollbar' do
    expect(Rollbar).to receive(:log).with('warning', UniformNotifier::Exception.new('notify rollbar'))

    UniformNotifier.rollbar = { level: 'warning' }
    UniformNotifier::RollbarNotifier.out_of_channel_notify(title: 'notify rollbar')
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
uniform_notifier-1.16.0 spec/uniform_notifier/rollbar_spec.rb
uniform_notifier-1.15.0 spec/uniform_notifier/rollbar_spec.rb
uniform_notifier-1.14.2 spec/uniform_notifier/rollbar_spec.rb
uniform_notifier-1.14.1 spec/uniform_notifier/rollbar_spec.rb
uniform_notifier-1.14.0 spec/uniform_notifier/rollbar_spec.rb
uniform_notifier-1.13.2 spec/uniform_notifier/rollbar_spec.rb
uniform_notifier-1.13.1 spec/uniform_notifier/rollbar_spec.rb
uniform_notifier-1.13.0 spec/uniform_notifier/rollbar_spec.rb