Sha256: f00ab638c059ac7bca575e17d18f2c242a25926cded381ce2ae2f59a00e94978

Contents?: true

Size: 890 Bytes

Versions: 15

Compression:

Stored size: 890 Bytes

Contents

require 'new_relic/control/frameworks/rails'

class NewRelic::Control::Frameworks::Test < NewRelic::Control::Frameworks::Rails #:nodoc:
  def env
    'test'
  end
  def app
    :rails
  end
  
  def initialize *args
    super
    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

15 entries across 15 versions & 2 rubygems

Version Path
newrelic_rpm-2.13.4.rum6 test/config/test_control.rb
newrelic_rpm-2.13.4.rum5 test/config/test_control.rb
newrelic_rpm-2.13.4.rum4 test/config/test_control.rb
newrelic_rpm-2.13.4.eum3 test/config/test_control.rb
newrelic_rpm-2.13.4.eum2 test/config/test_control.rb
newrelic_rpm-2.13.4.eum1 test/config/test_control.rb
newrelic_rpm-2.13.4 test/config/test_control.rb
newrelic_rpm-2.13.3 test/config/test_control.rb
newrelic_rpm-2.13.3.beta test/config/test_control.rb
newrelic_rpm-2.13.2 test/config/test_control.rb
honkster-newrelic_rpm-2.13.1 test/config/test_control.rb
newrelic_rpm-2.13.1 test/config/test_control.rb
newrelic_rpm-2.13.0.beta5 test/config/test_control.rb
newrelic_rpm-2.13.0.beta4 test/config/test_control.rb
newrelic_rpm-2.13.0.beta3 test/config/test_control.rb