Sha256: a6827d9f6442283087ba2428412dd4f6576a719b454e89fd85fb67cdba527221

Contents?: true

Size: 831 Bytes

Versions: 9

Compression:

Stored size: 831 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/rack/agent_hooks'

class AgentHooksTest < Test::Unit::TestCase

  def setup
    @app = stub_everything
    @hooks = NewRelic::Rack::AgentHooks.new(@app)
    @env = {:env => "env"}

    NewRelic::Agent.instance.events.stubs(:notify)
  end

  def test_before_call
    NewRelic::Agent.instance.events.expects(:notify).with(:before_call, @env)

    @hooks.call(@env)
  end

  def test_after_call
    result = stub
    @app.stubs(:call).returns(result)

    NewRelic::Agent.instance.events.expects(:notify).with(:after_call, @env, result)

    @hooks.call(@env)
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
newrelic_rpm-3.6.2.96 test/new_relic/rack/agent_hooks_test.rb
newrelic_rpm-3.6.2.90.beta test/new_relic/rack/agent_hooks_test.rb
newrelic_rpm-3.6.1.88 test/new_relic/rack/agent_hooks_test.rb
newrelic_rpm-3.6.1.87 test/new_relic/rack/agent_hooks_test.rb
newrelic_rpm-3.6.1.86.beta test/new_relic/rack/agent_hooks_test.rb
newrelic_rpm-3.6.1.85.beta test/new_relic/rack/agent_hooks_test.rb
newrelic_rpm-3.6.0.83 test/new_relic/rack/agent_hooks_test.rb
newrelic_rpm-3.6.0.78 test/new_relic/rack/agent_hooks_test.rb
newrelic_rpm-3.6.0.74.beta test/new_relic/rack/agent_hooks_test.rb