test/test_helper.rb in newrelic_rpm-3.4.2.beta1 vs test/test_helper.rb in newrelic_rpm-3.4.2
- old
+ new
@@ -119,11 +119,14 @@
end
def with_config(config_hash, level=0)
config = NewRelic::Agent::Configuration::DottedHash.new(config_hash)
NewRelic::Agent.config.apply_config(config, level)
- yield
- NewRelic::Agent.config.remove_config(config)
+ begin
+ yield
+ ensure
+ NewRelic::Agent.config.remove_config(config)
+ end
end
module TransactionSampleTestHelper
def make_sql_transaction(*sql)
sampler = NewRelic::Agent::TransactionSampler.new