Sha256: 8e3474a82134b69f8ed98b6a3553648f43741ec49ac717dcaf657daea2ff4e59
Contents?: true
Size: 954 Bytes
Versions: 9
Compression:
Stored size: 954 Bytes
Contents
# encoding: utf-8 # This file is distributed under New Relic's license terms. # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details. 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
9 entries across 9 versions & 1 rubygems