Sha256: 2e202861f608b0ed01fcb49c98b721affa771a8f28b7b41b757e58ad55bbd2d1

Contents?: true

Size: 1000 Bytes

Versions: 17

Compression:

Stored size: 1000 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'))

class NewRelic::DelayedJobInstrumentationTest < Test::Unit::TestCase
  def test_skip_logging_if_no_logger_found
    Object.const_set('Delayed', Module.new) unless defined?(Delayed)
    ::Delayed.const_set('Worker', Class.new) unless defined?(::Delayed::Worker)
    
    # on JRuby we need to make sure the worker isn't running, it might
    # try to log
    worker = NewRelic::Agent.agent.instance_variable_get(:@worker_loop)
    worker.stop if worker
    
    NewRelic::Agent.stubs(:logger).raises(NoMethodError,
                                          'temporarily not allowed')
    NewRelic::Agent.stubs(:respond_to?).with(:logger).returns(false)
    
    assert DependencyDetection.detect!
    
    Object.class_eval { remove_const('Delayed') }
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
newrelic_rpm-3.6.5.130 test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.4.122 test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.4.113.beta test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.3.111 test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.3.106 test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.3.105.beta test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.3.104 test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.3.103.beta test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.2.96 test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.2.90.beta test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.1.88 test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.1.87 test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.1.86.beta test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.1.85.beta test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.0.83 test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.0.78 test/new_relic/delayed_job_injection_test.rb
newrelic_rpm-3.6.0.74.beta test/new_relic/delayed_job_injection_test.rb