Sha256: 517a97d9fb7861cc7f3d2abbf183a0d34da541970a441ae87929b820723d6592

Contents?: true

Size: 704 Bytes

Versions: 49

Compression:

Stored size: 704 Bytes

Contents

require 'spec_helper'
require File.expand_path('lib/appsignal/instrumentations/net_http')

describe "Net::HTTP instrumentation" do
  let(:events) { [] }
  before do
    ActiveSupport::Notifications.subscribe(/^[^!]/) do |*args|
      events << ActiveSupport::Notifications::Event.new(*args)
    end
  end

  it "should instrument request" do
    stub_request(:any, 'www.google.com')

    Net::HTTP.get_response(URI.parse('http://www.google.com'))

    event = events.last
    event.name.should == 'request.net_http'
    event.payload[:host].should == 'www.google.com'
    event.payload[:scheme].should == 'http'
    event.payload[:path].should == '/'
    event.payload[:method].should == 'GET'
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
appsignal-0.11.8.beta.2 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.8.beta.1 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.8.beta.0 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.7 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.7.beta.1 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.6 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.6.beta.0 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.5 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.4 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.4.beta.0 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.3 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.2 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.1 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.0 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.0.beta.2 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.0.beta.1 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.10.6 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.10.5 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.10.4 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.10.3 spec/lib/appsignal/instrumentations/net_http_spec.rb