Sha256: 2415fcce25c177602c57a374b297a3e170a9122ecc08893ec0f88e93562c7b0d

Contents?: true

Size: 1.17 KB

Versions: 81

Compression:

Stored size: 1.17 KB

Contents

require 'new_relic/control/frameworks/rails'
require 'new_relic/control/frameworks/rails3'

if defined?(Rails) && Rails.respond_to?(:version) && Rails.version.to_i == 3
  parent_class = NewRelic::Control::Frameworks::Rails3
else
  parent_class = NewRelic::Control::Frameworks::Rails
end


class NewRelic::Control::Frameworks::Test < parent_class
  def env
    'test'
  end
  def app
    if defined?(Rails) && Rails.respond_to?(:version) && Rails.version.to_i == 3
      :rails3
    else
      :rails
    end
  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

81 entries across 81 versions & 4 rubygems

Version Path
newrelic_rpm-3.5.4.35.beta test/config/test_control.rb
newrelic_rpm-3.5.4.34 test/config/test_control.rb
newrelic_rpm-3.5.4.33 test/config/test_control.rb
newrelic_rpm-3.5.4.31.beta test/config/test_control.rb
newrelic_rpm-3.5.4.29.beta test/config/test_control.rb
ghazel-newrelic_rpm-3.5.4 test/config/test_control.rb
newrelic_rpm-3.5.3.25 test/config/test_control.rb
newrelic_rpm-3.5.3.24 test/config/test_control.rb
newrelic_rpm-3.5.2.17 test/config/test_control.rb
newrelic_rpm-3.5.1.14 test/config/test_control.rb
newrelic_rpm-3.5.1.14.beta test/config/test_control.rb
newrelic_rpm-3.5.1.beta1 test/config/test_control.rb
newrelic_rpm-3.5.0.1 test/config/test_control.rb
newrelic_rpm-3.5.1.alpha test/config/test_control.rb
newrelic_rpm-3.5.0 test/config/test_control.rb
newrelic_rpm-3.4.2.1 test/config/test_control.rb
newrelic_rpm-3.4.2 test/config/test_control.rb
newrelic_rpm-3.4.2.beta1 test/config/test_control.rb
newrelic_rpm-3.4.1 test/config/test_control.rb
newrelic_rpm-3.4.1.beta1 test/config/test_control.rb