test/multiverse/suites/rack/example_app.rb in newrelic_rpm-3.9.9.275 vs test/multiverse/suites/rack/example_app.rb in newrelic_rpm-3.10.0.279
- old
+ new
@@ -2,11 +2,41 @@
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
class ExampleApp
def call(env)
- ['200', {'Content-Type' => 'text/html', 'ExampleApp' => '0'}, ['A barebones rack app.']]
+ req = Rack::Request.new(env)
+ body = req.params['body'] || 'A barebones rack app.'
+
+ status = '404' unless req.path == '/'
+ [status || '200', {'Content-Type' => 'text/html', 'ExampleApp' => '0'}, [body]]
end
+end
+
+class FirstCascadeExampleApp
+ include NewRelic::Agent::Instrumentation::ControllerInstrumentation
+
+ def call(env)
+ req = Rack::Request.new(env)
+ body = req.params['body'] || 'A barebones rack cascade app.'
+
+ status = '404' unless req.path == '/'
+ [status || '200', {'Content-Type' => 'text/html', 'FirstCascadeExampleApp' => '0'}, [body]]
+ end
+ add_transaction_tracer :call
+end
+
+class SecondCascadeExampleApp
+ include NewRelic::Agent::Instrumentation::ControllerInstrumentation
+
+ def call(env)
+ req = Rack::Request.new(env)
+ body = req.params['body'] || 'A barebones rack cascade app.'
+
+ status = '404' unless req.path == '/'
+ [status || '200', {'Content-Type' => 'text/html', 'SecondCascadeExampleApp' => '0'}, [body]]
+ end
+ add_transaction_tracer :call
end
class MiddlewareOne
def initialize(app)
@app = app