Sha256: 2bb3557b70d03809ad8925e4688f41f884bfd2ddc9fa62d401b7b0696a139337

Contents?: true

Size: 833 Bytes

Versions: 9

Compression:

Stored size: 833 Bytes

Contents

require 'new_relic/config/rails'
require 'new_relic/agent/agent_test_controller'

class NewRelic::Config::Test < NewRelic::Config::Rails
  def env
    'test'
  end
  def config_file
    File.join(File.dirname(__FILE__), "newrelic.yml")
  end
  def initialize
    super
    setup_log env
  end
  # when running tests, don't write out stderr
  def log!(msg, level=:info)
    log.send level, msg if log
  end
  
  # Add the default route in case it's missing.  Need it for testing.
  def install_devmode_route
    if super
      ActionController::Routing::RouteSet.class_eval do
      def draw_with_test_route
        draw_without_test_route do | map |
          map.connect ':controller/:action/:id'
          yield map        
        end
      end
      alias_method_chain :draw, :test_route
    end
    return true
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
newrelic_rpm-2.8.10 test/config/test_config.rb
newrelic_rpm-2.8.11 test/config/test_config.rb
newrelic_rpm-2.8.3 test/config/test_config.rb
newrelic_rpm-2.8.4 test/config/test_config.rb
newrelic_rpm-2.8.5 test/config/test_config.rb
newrelic_rpm-2.8.6 test/config/test_config.rb
newrelic_rpm-2.8.7 test/config/test_config.rb
newrelic_rpm-2.8.8 test/config/test_config.rb
newrelic_rpm-2.8.9 test/config/test_config.rb