Sha256: 685ad68756e1f7e72b333dd6fdfb4d71aa76adcbcb88e7c60eced407ebfe391a

Contents?: true

Size: 795 Bytes

Versions: 24

Compression:

Stored size: 795 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'test_helper'))
require 'new_relic/agent/instrumentation/sinatra'

class NewRelic::Agent::Instrumentation::SinatraTest < Test::Unit::TestCase
  class SinatraTestApp
    def initialize(response)
      @response = response
    end

    def dispatch!
      @response = response
    end

    include NewRelic::Agent::Instrumentation::Sinatra
    alias dispatch_without_newrelic dispatch!
    alias dispatch! dispatch_with_newrelic
  end

  def test_newrelic_request_headers
    app = SinatraTestApp.new([200, {}, ["OK"]])
    expected_headers = {:fake => :header}
    app.expects(:request).returns(mock('request', :env => expected_headers))
    assert_equal app.send(:newrelic_request_headers), expected_headers
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
wd_newrelic_rpm-3.5.8 test/new_relic/agent/instrumentation/sinatra_test.rb
sundawg_newrelic_rpm-3.5.8.2 test/new_relic/agent/instrumentation/sinatra_test.rb
sundawg_newrelic_rpm-3.5.8.1 test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.8.72 test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.8.70 test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.8.64.beta test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.7.59 test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.7.59.beta test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.7.58.beta test/new_relic/agent/instrumentation/sinatra_test.rb
wd_newrelic_rpm-3.5.6 test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.7.57.beta test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.6.55 test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.6.48.beta test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.6.46.beta test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.6.42.beta test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.5.39.beta test/new_relic/agent/instrumentation/sinatra_test.rb
wd_newrelic_rpm-3.5.5 test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.5.38 test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.5.540.dev test/new_relic/agent/instrumentation/sinatra_test.rb
newrelic_rpm-3.5.4.35.beta test/new_relic/agent/instrumentation/sinatra_test.rb