diff --git a/lib/new_relic/rack/metric_app.rb b/lib/new_relic/rack/metric_app.rb index 3ce83d5c0d..91fe3718d6 100644 --- a/lib/new_relic/rack/metric_app.rb +++ b/lib/new_relic/rack/metric_app.rb @@ -20,8 +20,7 @@ def initialize(options) options[:disable_samplers] = true NewRelic::Agent.manual_start options unless NewRelic::Control.instance.license_key - NewRelic::Agent.logger.error "Please add a valid license key to newrelic.yml." - exit 1 + raise "Please add a valid license key to newrelic.yml." end end def call(env) diff --git a/test/new_relic/agent/rpm_agent_test.rb b/test/new_relic/agent/rpm_agent_test.rb index c4c5916592..f2f6fc9365 100644 --- a/test/new_relic/agent/rpm_agent_test.rb +++ b/test/new_relic/agent/rpm_agent_test.rb @@ -128,8 +128,13 @@ class RpmAgentTest < Test::Unit::TestCase # ActiveSupport::TestCase end context "with transaction api" do + should "reject empty arguments" do + assert_raises RuntimeError do + NewRelic::Agent.record_transaction 0.5 + end + end should "record a transaction" do - NewRelic::Agent.record_transaction 0.5, :uri => "/users/create?foo=bar" + NewRelic::Agent.record_transaction 0.5, 'uri' => "/users/create?foo=bar" end end