Sha256: ee9195724dc59ea4a6394b49c12c20dbc71ac8787c87f3cc88d0c692c84078a9

Contents?: true

Size: 1008 Bytes

Versions: 3

Compression:

Stored size: 1008 Bytes

Contents

require 'spec_helper'

describe Appsignal::ExceptionNotification do
  let(:error) { StandardError.new('moo') }
  let(:notification) { Appsignal::ExceptionNotification.new({}, error, false) }
  subject { notification }
  before do
    Rails.stub(:root => '/home/app/current')
  end

  its(:env) { should == {} }
  its(:exception) { should == error }
  its(:name) { should == 'StandardError' }
  its(:message) { should == 'moo' }

  context "backtrace" do
    let(:backtrace) do
      [
        '/home/app/current/app/controllers/somethings_controller.rb:10',
        '/user/local/ruby/path.rb:8'
      ]
    end
    before { error.stub(:backtrace => backtrace) }

    subject { notification.backtrace }

    it { should == backtrace }

    context "when running the backtrace cleaner" do
      let(:notification) { Appsignal::ExceptionNotification.new({}, error) }

      it { should == [
        'app/controllers/somethings_controller.rb:10',
        '/user/local/ruby/path.rb:8'
      ] }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
appsignal-0.6.3.beta.2 spec/appsignal/exception_notification_spec.rb
appsignal-0.6.3.beta.1 spec/appsignal/exception_notification_spec.rb
appsignal-0.6.2 spec/appsignal/exception_notification_spec.rb