Sha256: 6c289f85270f485b1fc447498203ef9fff84d222bf8183fdba4ba4990baec7a4

Contents?: true

Size: 572 Bytes

Versions: 13

Compression:

Stored size: 572 Bytes

Contents

require 'spec_helper'
require 'rack/test'

describe 'Rescue from within a rack app' do
  include Rack::Test::Methods

  before do
    CrashLog.configure do |config|
      config.api_key = 'project-api-key'
      config.dry_run = true
    end
  end

  def app
    Rack::Builder.app do
      use CrashLog::Rack
      run lambda { |env| raise "Fully Racked" }
    end
  end

  it 'should capture exception within rack app' do
    CrashLog.should_receive(:notify).with(kind_of(RuntimeError), kind_of(Hash)).once

    lambda {
      get '/'
    }.should raise_error
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
crashlog-1.1.0.pre1 spec/requests/rack_spec.rb
crashlog-1.0.7 spec/requests/rack_spec.rb
crashlog-1.0.6 spec/requests/rack_spec.rb
crashlog-1.0.5 spec/requests/rack_spec.rb
crashlog-1.0.4 spec/requests/rack_spec.rb
crashlog-1.0.3 spec/requests/rack_spec.rb
crashlog-1.0.2.1 spec/requests/rack_spec.rb
crashlog-1.0.2 spec/requests/rack_spec.rb
crashlog-1.0.1 spec/requests/rack_spec.rb
crashlog-1.0.0 spec/requests/rack_spec.rb
crashlog-1.0.0.rc2 spec/requests/rack_spec.rb
crashlog-1.0.0.rc1 spec/requests/rack_spec.rb
crashlog-0.0.2 spec/requests/rack_spec.rb