Skip to content

Commit

Permalink
Fix warnings about shadowing outer local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dx7 authored and kwugirl committed Jan 29, 2016
1 parent da24d79 commit 51e44b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/tasks/tests.rake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ rescue LoadError => e
end

if defined? Rake::TestTask
namespace :test do |t|
namespace :test do
def look_for_seed(tasks)
matches = tasks.map { |t| /(seed=.*?)[,\]]/.match(t) }.compact
if matches.any?
Expand Down
28 changes: 14 additions & 14 deletions test/new_relic/agent/transaction_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1293,10 +1293,10 @@ def test_adding_intrinsic_attributes
end

def test_assigns_synthetics_to_intrinsic_attributes
txn = in_transaction do |txn|
txn.raw_synthetics_header = ""
txn.synthetics_payload = [1, 1, 100, 200, 300]
txn
txn = in_transaction do |t|
t.raw_synthetics_header = ""
t.synthetics_payload = [1, 1, 100, 200, 300]
t
end

result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
Expand All @@ -1307,7 +1307,7 @@ def test_assigns_synthetics_to_intrinsic_attributes


def test_intrinsic_attributes_include_gc_time
txn = in_transaction do |txn|
txn = in_transaction do |t|
NewRelic::Agent::StatsEngine::GCProfiler.stubs(:record_delta).returns(10.0)
end

Expand All @@ -1320,9 +1320,9 @@ def test_intrinsic_attributes_include_tripid

NewRelic::Agent.instance.cross_app_monitor.stubs(:client_referring_transaction_trip_id).returns('PDX-NRT')

txn = in_transaction do |txn|
txn = in_transaction do |t|
NewRelic::Agent::TransactionState.tl_get.is_cross_app_caller = true
guid = txn.guid
guid = t.guid
end

result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
Expand All @@ -1343,20 +1343,20 @@ def test_intrinsic_attributes_dont_include_tripid_if_not_cross_app_transaction
def test_intrinsic_attributes_include_path_hash
path_hash = nil

txn = in_transaction do |txn|
txn = in_transaction do |t|
state = NewRelic::Agent::TransactionState.tl_get
state.is_cross_app_caller = true
path_hash = txn.cat_path_hash(state)
path_hash = t.cat_path_hash(state)
end

result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
assert_equal path_hash, result[:path_hash]
end

def test_synthetics_attributes_not_included_if_not_valid_synthetics_request
txn = in_transaction do |txn|
txn.raw_synthetics_header = nil
txn.synthetics_payload = nil
txn = in_transaction do |t|
t.raw_synthetics_header = nil
t.synthetics_payload = nil
end

result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
Expand All @@ -1366,8 +1366,8 @@ def test_synthetics_attributes_not_included_if_not_valid_synthetics_request
end

def test_intrinsic_attributes_include_cpu_time
txn = in_transaction do |txn|
txn.stubs(:cpu_burn).returns(22.0)
txn = in_transaction do |t|
t.stubs(:cpu_burn).returns(22.0)
end

result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
Expand Down

0 comments on commit 51e44b5

Please sign in to comment.