Sha256: befd3d0c4a7118936ca957fb7ea93ffef107af1710a8146e5a296f4f371f58ca

Contents?: true

Size: 972 Bytes

Versions: 7

Compression:

Stored size: 972 Bytes

Contents

require 'spec_helper'

Rollbar.plugins.load!

describe Rollbar::Rake do
  let(:application) { Rake::Application.new }
  let(:exception) { Exception.new }

  context 'with supported rake version' do
    before do
      allow(Rollbar::Rake).to receive(:rake_version).and_return('0.9.0')
    end

    it 'reports error to Rollbar' do
      expect(Rollbar::Rake).not_to receive(:skip_patch)
      expect(Rollbar).to receive(:error).with(exception, :use_exception_level_filters => true)
      expect(application).to receive(:orig_display_error_message).with(exception)

      Rollbar::Rake.patch! # Really here Rake is already patched
      application.display_error_message(exception)
    end
  end

  context 'with unsupported rake version' do
    before do
      allow(Rollbar::Rake).to receive(:rake_version).and_return('0.8.7')
    end

    it 'reports error to Rollbar' do
      expect(Rollbar::Rake).to receive(:skip_patch)

      Rollbar::Rake.patch!
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rollbar-2.12.0 spec/rollbar/plugins/rake_spec.rb
rollbar-2.11.5 spec/rollbar/plugins/rake_spec.rb
rollbar-2.11.4 spec/rollbar/plugins/rake_spec.rb
rollbar-2.11.3 spec/rollbar/plugins/rake_spec.rb
rollbar-2.11.2 spec/rollbar/plugins/rake_spec.rb
rollbar-2.11.1 spec/rollbar/plugins/rake_spec.rb
rollbar-2.11.0 spec/rollbar/plugins/rake_spec.rb