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.18 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.17 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.16 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.15 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.14 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.14.beta.1 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.13 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.13.beta.4 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.13.beta.3 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.13.beta.2 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.13.beta.1 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.13.beta.0 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.12 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.11 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.10 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.10.beta.2 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.10.beta.1 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.9 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.8.beta.4 spec/lib/appsignal/instrumentations/net_http_spec.rb
appsignal-0.11.8.beta.3 spec/lib/appsignal/instrumentations/net_http_spec.rb