Sha256: 670cbe6ee9b8a1d095189b7fd2fcd59c8b5f6884f7ca93f3381733cbfe469198

Contents?: true

Size: 874 Bytes

Versions: 47

Compression:

Stored size: 874 Bytes

Contents

require 'spec_helper'
require 'rollbar/delay/resque'

describe Rollbar::Delay::Resque do
  describe '.call' do
    let(:payload) do
      { :key => 'value' }
    end

    let(:loaded_hash) do
      Rollbar::JSON.load(Rollbar::JSON.dump(payload))
    end

    before do
      allow(Resque).to receive(:inline?).and_return(true)
    end

    it 'process the payload' do
      expect(Rollbar).to receive(:process_from_async_handler).with(loaded_hash)
      described_class.call(payload)
    end

    context 'with exceptions processing payload' do
      let(:exception) { Exception.new }

      before do
        expect(Rollbar).to receive(:process_from_async_handler).with(loaded_hash).and_raise(exception)
      end

      it 'raises an exception' do
        expect do
          described_class.call(payload)
        end.to raise_error(exception)
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
rollbar-2.18.2 spec/rollbar/delay/resque_spec.rb
rollbar-2.18.0 spec/rollbar/delay/resque_spec.rb
rollbar-2.17.0 spec/rollbar/delay/resque_spec.rb
rollbar-2.16.4 spec/rollbar/delay/resque_spec.rb
rollbar-2.16.3 spec/rollbar/delay/resque_spec.rb
rollbar-2.16.2 spec/rollbar/delay/resque_spec.rb
rollbar-2.16.0 spec/rollbar/delay/resque_spec.rb
rollbar-2.15.6 spec/rollbar/delay/resque_spec.rb
rollbar-2.15.5 spec/rollbar/delay/resque_spec.rb
rollbar-2.15.4 spec/rollbar/delay/resque_spec.rb
rollbar-2.15.3 spec/rollbar/delay/resque_spec.rb
rollbar-2.15.2 spec/rollbar/delay/resque_spec.rb
rollbar-2.15.1 spec/rollbar/delay/resque_spec.rb
rollbar-2.15.0 spec/rollbar/delay/resque_spec.rb
rollbar-2.14.1 spec/rollbar/delay/resque_spec.rb
rollbar-2.14.0 spec/rollbar/delay/resque_spec.rb
rollbar-2.13.3 spec/rollbar/delay/resque_spec.rb
rollbar-2.13.2 spec/rollbar/delay/resque_spec.rb
rollbar-2.13.1 spec/rollbar/delay/resque_spec.rb
rollbar-2.13.0 spec/rollbar/delay/resque_spec.rb