Sha256: 8c9f5a7f3574eac9ebbb5875362ae6a630f8bca853621bd3d5ef69a7e4fa0a07

Contents?: true

Size: 744 Bytes

Versions: 8

Compression:

Stored size: 744 Bytes

Contents

require 'webrick'
require 'spec_helper'

describe 'Bugsnag' do
  server = nil
  queue = Queue.new

  before do
    server = WEBrick::HTTPServer.new :Port => 0, :Logger => WEBrick::Log.new("/dev/null"), :AccessLog => []
    server.mount_proc '/' do |req, res|
      queue.push req.body
      res.status = 200
      res.body = "OK\n"
    end
    Thread.new{ server.start }
  end
  after do
    server.stop
  end

  let(:request) { JSON.parse(queue.pop) }

  it 'should send notifications over the wire' do
    Bugsnag.configure do |config|
      config.endpoint = "localhost:#{server.config[:Port]}"
      config.use_ssl = false
    end

    Bugsnag.notify 'yo'

    expect(request['events'][0]['exceptions'][0]['message']).to eq('yo')
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bugsnag-2.5.1 spec/integration_spec.rb
bugsnag-2.5.0 spec/integration_spec.rb
bugsnag-2.4.1 spec/integration_spec.rb
bugsnag-2.4.0 spec/integration_spec.rb
bugsnag-2.3.0 spec/integration_spec.rb
bugsnag-2.2.2 spec/integration_spec.rb
bugsnag-2.2.1 spec/integration_spec.rb
bugsnag-2.2.0 spec/integration_spec.rb