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.12.0 spec/rollbar/delay/resque_spec.rb
rollbar-2.11.5 spec/rollbar/delay/resque_spec.rb
rollbar-2.11.4 spec/rollbar/delay/resque_spec.rb
rollbar-2.11.3 spec/rollbar/delay/resque_spec.rb
rollbar-2.11.2 spec/rollbar/delay/resque_spec.rb
rollbar-2.11.1 spec/rollbar/delay/resque_spec.rb
rollbar-2.11.0 spec/rollbar/delay/resque_spec.rb
rollbar-2.10.0 spec/rollbar/delay/resque_spec.rb
rollbar-2.9.1 spec/rollbar/delay/resque_spec.rb
rollbar-2.9.0 spec/rollbar/delay/resque_spec.rb
rollbar-2.8.3 spec/rollbar/delay/resque_spec.rb
rollbar-2.8.2 spec/rollbar/delay/resque_spec.rb
rollbar-2.8.1 spec/rollbar/delay/resque_spec.rb
rollbar-2.8.0 spec/rollbar/delay/resque_spec.rb
rollbar-2.7.1 spec/rollbar/delay/resque_spec.rb
rollbar-2.7.0 spec/rollbar/delay/resque_spec.rb
rollbar-2.6.3 spec/rollbar/delay/resque_spec.rb
rollbar-2.6.2 spec/rollbar/delay/resque_spec.rb
rollbar-2.6.1 spec/rollbar/delay/resque_spec.rb
rollbar-2.6.0 spec/rollbar/delay/resque_spec.rb