diff options
Diffstat (limited to 'activejob')
-rw-r--r-- | activejob/Rakefile | 2 | ||||
-rw-r--r-- | activejob/lib/active_job/enqueuing.rb | 4 | ||||
-rw-r--r-- | activejob/lib/active_job/test_helper.rb | 10 | ||||
-rw-r--r-- | activejob/test/cases/queue_priority_test.rb | 2 | ||||
-rw-r--r-- | activejob/test/cases/test_helper_test.rb | 4 | ||||
-rw-r--r-- | activejob/test/helper.rb | 1 | ||||
-rw-r--r-- | activejob/test/support/integration/adapters/sneakers.rb | 2 | ||||
-rw-r--r-- | activejob/test/support/integration/test_case_helpers.rb | 2 |
8 files changed, 14 insertions, 13 deletions
diff --git a/activejob/Rakefile b/activejob/Rakefile index 3953116061..c074487fbe 100644 --- a/activejob/Rakefile +++ b/activejob/Rakefile @@ -2,7 +2,7 @@ require "rake/testtask" #TODO: add qu back to the list after it support Rails 5.1 ACTIVEJOB_ADAPTERS = %w(async inline delayed_job que queue_classic resque sidekiq sneakers sucker_punch backburner test) -ACTIVEJOB_ADAPTERS -= %w(queue_classic) if defined?(JRUBY_VERSION) +ACTIVEJOB_ADAPTERS.delete("queue_classic") if defined?(JRUBY_VERSION) task default: :test task test: "test:default" diff --git a/activejob/lib/active_job/enqueuing.rb b/activejob/lib/active_job/enqueuing.rb index 78eca1d2a1..c73117e7f3 100644 --- a/activejob/lib/active_job/enqueuing.rb +++ b/activejob/lib/active_job/enqueuing.rb @@ -18,8 +18,8 @@ module ActiveJob job_or_instantiate(*args).enqueue end - protected - def job_or_instantiate(*args) + private + def job_or_instantiate(*args) # :doc: args.first.is_a?(self) ? args.first : new(*args) end end diff --git a/activejob/lib/active_job/test_helper.rb b/activejob/lib/active_job/test_helper.rb index e6334d14ea..d01795f0c5 100644 --- a/activejob/lib/active_job/test_helper.rb +++ b/activejob/lib/active_job/test_helper.rb @@ -315,15 +315,15 @@ module ActiveJob end private - def clear_enqueued_jobs # :nodoc: + def clear_enqueued_jobs enqueued_jobs.clear end - def clear_performed_jobs # :nodoc: + def clear_performed_jobs performed_jobs.clear end - def enqueued_jobs_size(only: nil) # :nodoc: + def enqueued_jobs_size(only: nil) if only enqueued_jobs.count { |job| Array(only).include?(job.fetch(:job)) } else @@ -331,14 +331,14 @@ module ActiveJob end end - def serialize_args_for_assertion(args) # :nodoc: + def serialize_args_for_assertion(args) args.dup.tap do |serialized_args| serialized_args[:args] = ActiveJob::Arguments.serialize(serialized_args[:args]) if serialized_args[:args] serialized_args[:at] = serialized_args[:at].to_f if serialized_args[:at] end end - def instantiate_job(payload) # :nodoc: + def instantiate_job(payload) job = payload[:job].new(*payload[:args]) job.scheduled_at = Time.at(payload[:at]) if payload.key?(:at) job.queue_name = payload[:queue] diff --git a/activejob/test/cases/queue_priority_test.rb b/activejob/test/cases/queue_priority_test.rb index ec78a402d7..b0d0e903fc 100644 --- a/activejob/test/cases/queue_priority_test.rb +++ b/activejob/test/cases/queue_priority_test.rb @@ -3,7 +3,7 @@ require "jobs/hello_job" class QueuePriorityTest < ActiveSupport::TestCase test "priority unset by default" do - assert_equal nil, HelloJob.priority + assert_nil HelloJob.priority end test "uses given priority" do diff --git a/activejob/test/cases/test_helper_test.rb b/activejob/test/cases/test_helper_test.rb index 685c93da2d..51fc6cc0c4 100644 --- a/activejob/test/cases/test_helper_test.rb +++ b/activejob/test/cases/test_helper_test.rb @@ -256,11 +256,11 @@ end class PerformedJobsTest < ActiveJob::TestCase def test_performed_enqueue_jobs_with_only_option_doesnt_leak_outside_the_block - assert_equal nil, queue_adapter.filter + assert_nil queue_adapter.filter perform_enqueued_jobs only: HelloJob do assert_equal HelloJob, queue_adapter.filter end - assert_equal nil, queue_adapter.filter + assert_nil queue_adapter.filter end def test_assert_performed_jobs diff --git a/activejob/test/helper.rb b/activejob/test/helper.rb index 758506b3c0..776f7788de 100644 --- a/activejob/test/helper.rb +++ b/activejob/test/helper.rb @@ -5,6 +5,7 @@ ActiveSupport.halt_callback_chains_on_return_false = false GlobalID.app = "aj" @adapter = ENV["AJ_ADAPTER"] || "inline" +puts "Using #{@adapter}" if ENV["AJ_INTEGRATION_TESTS"] require "support/integration/helper" diff --git a/activejob/test/support/integration/adapters/sneakers.rb b/activejob/test/support/integration/adapters/sneakers.rb index 911f70407e..1c8dfaca59 100644 --- a/activejob/test/support/integration/adapters/sneakers.rb +++ b/activejob/test/support/integration/adapters/sneakers.rb @@ -73,7 +73,7 @@ module SneakersJobsManager true end - protected + private def bunny_publisher @bunny_publisher ||= begin p = ActiveJob::QueueAdapters::SneakersAdapter::JobWrapper.send(:publisher) diff --git a/activejob/test/support/integration/test_case_helpers.rb b/activejob/test/support/integration/test_case_helpers.rb index 3357489f20..41bf9c89d1 100644 --- a/activejob/test/support/integration/test_case_helpers.rb +++ b/activejob/test/support/integration/test_case_helpers.rb @@ -17,7 +17,7 @@ module TestCaseHelpers end end - protected + private def jobs_manager JobsManager.current_manager |