Sha256: 965672eca766aa081583cbc1a4caccfdb74c1e645249dc813e6d164f747f3fd8

Contents?: true

Size: 934 Bytes

Versions: 5

Compression:

Stored size: 934 Bytes

Contents

require 'spec_helper'
require 'rollbar/rake'

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)
      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

5 entries across 5 versions & 1 rubygems

Version Path
rollbar-1.3.2 spec/rollbar/rake_spec.rb
rollbar-1.3.1 spec/rollbar/rake_spec.rb
rollbar-1.3.0 spec/rollbar/rake_spec.rb
rollbar-1.2.13 spec/rollbar/rake_spec.rb
rollbar-1.2.12 spec/rollbar/rake_spec.rb