From 5b825c55fea48c7c32921a62e4d10a99fdbe8a87 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Fri, 18 Nov 2016 18:20:48 +0900 Subject: [PATCH] remove Ruby warning from Active Job test helper methods This removes the following warnings. ``` /home/travis/build/rails/rails/activejob/lib/active_job/test_helper.rb:241: warning: shadowing outer local variable - job /home/travis/build/rails/rails/activejob/lib/active_job/test_helper.rb:265: warning: shadowing outer local variable - job ``` --- activejob/lib/active_job/test_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/activejob/lib/active_job/test_helper.rb b/activejob/lib/active_job/test_helper.rb index 9e45c0da24..e6334d14ea 100644 --- a/activejob/lib/active_job/test_helper.rb +++ b/activejob/lib/active_job/test_helper.rb @@ -238,8 +238,8 @@ module ActiveJob serialized_args = serialize_args_for_assertion(expected) yield in_block_jobs = enqueued_jobs.drop(original_enqueued_jobs_count) - matching_job = in_block_jobs.find do |job| - serialized_args.all? { |key, value| value == job[key] } + matching_job = in_block_jobs.find do |in_block_job| + serialized_args.all? { |key, value| value == in_block_job[key] } end assert matching_job, "No enqueued job found with #{expected}" instantiate_job(matching_job) @@ -262,8 +262,8 @@ module ActiveJob serialized_args = serialize_args_for_assertion(expected) perform_enqueued_jobs { yield } in_block_jobs = performed_jobs.drop(original_performed_jobs_count) - matching_job = in_block_jobs.find do |job| - serialized_args.all? { |key, value| value == job[key] } + matching_job = in_block_jobs.find do |in_block_job| + serialized_args.all? { |key, value| value == in_block_job[key] } end assert matching_job, "No performed job found with #{expected}" instantiate_job(matching_job)