Sha256: 66531d65b908db2522a8b45f399a5aaaea23ae67cd4adbf6bc097af17c548c71

Contents?: true

Size: 982 Bytes

Versions: 7

Compression:

Stored size: 982 Bytes

Contents

require 'new_relic/control/rails'
require 'new_relic/agent/agent_test_controller'

class NewRelic::Control::Test < NewRelic::Control::Rails
  def env
    'test'
  end
  def app
    :rails
  end
  def config_file
    File.join(File.dirname(__FILE__), "newrelic.yml")
  end
  def initialize local_env
    super local_env
    setup_log 
  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
    super
    ActionController::Routing::RouteSet.class_eval do
      return if defined? draw_without_test_route
      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
    # Force the routes to be reloaded
    ActionController::Routing::Routes.reload!
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-2.9.9 test/config/test_control.rb
newrelic_rpm-2.9.8 test/config/test_control.rb
newrelic_rpm-2.9.6 test/config/test_control.rb
newrelic_rpm-2.9.5 test/config/test_control.rb
newrelic_rpm-2.9.2 test/config/test_control.rb
newrelic_rpm-2.9.3 test/config/test_control.rb
newrelic_rpm-2.9.4 test/config/test_control.rb