Sha256: 362f406bc6d39990903d0b8ddedd1fb7d6703b4f18f8ecdbd0c0c0674a8550d8

Contents?: true

Size: 975 Bytes

Versions: 4

Compression:

Stored size: 975 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/transaction_reset'
require 'new_relic/agent/transaction_state'

module NewRelic
  module Rack
    class TransactionResetTest < Minitest::Test
      class ExampleMiddleware
        include TransactionReset
      end

      attr_reader :middleware, :env

      def setup
        @middleware = ExampleMiddleware.new
        @env = {}
      end

      def test_resets
        NewRelic::Agent::TransactionState.expects(:reset).once
        middleware.ensure_transaction_reset(env)
      end

      def test_resets_only_once
        NewRelic::Agent::TransactionState.expects(:reset).once
        middleware.ensure_transaction_reset(env)
        middleware.ensure_transaction_reset(env)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
newrelic_rpm-3.8.1.221 test/new_relic/rack/transaction_reset_test.rb
newrelic_rpm-3.8.0.218 test/new_relic/rack/transaction_reset_test.rb
newrelic_rpm-3.7.3.204 test/new_relic/rack/transaction_reset_test.rb
newrelic_rpm-3.7.3.199 test/new_relic/rack/transaction_reset_test.rb