Sha256: 7bf3120c3924e2d7a5b4884e4eafaf431898b55c433696b72f52f0dfb750f697

Contents?: true

Size: 950 Bytes

Versions: 96

Compression:

Stored size: 950 Bytes

Contents

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

class MinimalRackApp
  def initialize(return_value)
    @return_value = return_value
  end

  def call(env)
    @return_value
  end

  include NewRelic::Agent::Instrumentation::Rack
end

class NewRelic::Agent::Instrumentation::RackTest < Test::Unit::TestCase

  def test_basic_rack_app
    # should return what we send in, even when instrumented
    x = MinimalRackApp.new([200, {}, ["whee"]])
    assert_equal [200, {}, ["whee"]], x.call({})
  end

  def test_basic_rack_app_404
    x = MinimalRackApp.new([404, {}, ["whee"]])
    assert_equal [404, {}, ["whee"]], x.call({})
  end

  def test_basic_rack_app_ignores_404
    NewRelic::Agent::Instrumentation::MetricFrame.expects(:abort_transaction!)
    x = MinimalRackApp.new([404, {}, ["whee"]])
    assert_equal [404, {}, ["whee"]], x.call({})
  end
end

Version data entries

96 entries across 96 versions & 5 rubygems

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