Sha256: bbacb30d862b987cfcfb68458719e4777bec5a2789618e832f53d0d407c2bed7

Contents?: true

Size: 774 Bytes

Versions: 29

Compression:

Stored size: 774 Bytes

Contents

module TestContexts
  def with_running_agent

    context 'with running agent' do # this is needed for the nested setups

      setup do
        @log_data = StringIO.new
        @log = Logger.new(@log_data)
        NewRelic::Agent::Agent.instance.service = NewRelic::FakeService.new
        NewRelic::Agent.manual_start :log => @log
        @agent = NewRelic::Agent.instance
        @agent.transaction_sampler.send :clear_builder
        @agent.transaction_sampler.reset!
        @agent.stats_engine.clear_stats
      end

      yield

      def teardown
        super
        NewRelic::Agent.shutdown
        @log_data.reset
        NewRelic::Control.instance['dispatcher']=nil
        NewRelic::Control.instance['dispatcher_instance_id']=nil
      end

    end
  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
newrelic_rpm-3.5.5.39.beta test/test_contexts.rb
wd_newrelic_rpm-3.5.5 test/test_contexts.rb
newrelic_rpm-3.5.5.38 test/test_contexts.rb
newrelic_rpm-3.5.5.540.dev test/test_contexts.rb
newrelic_rpm-3.5.4.35.beta test/test_contexts.rb
newrelic_rpm-3.5.4.34 test/test_contexts.rb
newrelic_rpm-3.5.4.33 test/test_contexts.rb
newrelic_rpm-3.5.4.31.beta test/test_contexts.rb
newrelic_rpm-3.5.4.29.beta test/test_contexts.rb
ghazel-newrelic_rpm-3.5.4 test/test_contexts.rb
newrelic_rpm-3.5.3.25 test/test_contexts.rb
newrelic_rpm-3.5.3.24 test/test_contexts.rb
newrelic_rpm-3.5.2.17 test/test_contexts.rb
newrelic_rpm-3.5.1.14 test/test_contexts.rb
newrelic_rpm-3.5.1.14.beta test/test_contexts.rb
newrelic_rpm-3.5.1.beta1 test/test_contexts.rb
newrelic_rpm-3.5.0.1 test/test_contexts.rb
newrelic_rpm-3.5.1.alpha test/test_contexts.rb
newrelic_rpm-3.5.0 test/test_contexts.rb
newrelic_rpm-3.4.2.1 test/test_contexts.rb