aboutsummaryrefslogtreecommitdiffstats
path: root/activejob
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-06-30 17:58:02 +0900
committerGitHub <noreply@github.com>2018-06-30 17:58:02 +0900
commitb3653aee947a5f8c3a298913e539493d17c1932b (patch)
tree15876fe49c35e3e5c5f7bf5a940bbbffd85e5c02 /activejob
parent8ae3d17c9275cf65ec5891f046ad512bb9e8f9bd (diff)
parente862ee86b736f222d52202767f1d060defe0c766 (diff)
downloadrails-b3653aee947a5f8c3a298913e539493d17c1932b.tar.gz
rails-b3653aee947a5f8c3a298913e539493d17c1932b.tar.bz2
rails-b3653aee947a5f8c3a298913e539493d17c1932b.zip
Merge pull request #33257 from utilum/ruby-warnings
Fix Ruby warnings tickled by the test suite
Diffstat (limited to 'activejob')
-rw-r--r--activejob/test/support/queue_classic/inline.rb7
-rw-r--r--activejob/test/support/sneakers/inline.rb3
2 files changed, 6 insertions, 4 deletions
diff --git a/activejob/test/support/queue_classic/inline.rb b/activejob/test/support/queue_classic/inline.rb
index ca3cd4581b..0695a34c27 100644
--- a/activejob/test/support/queue_classic/inline.rb
+++ b/activejob/test/support/queue_classic/inline.rb
@@ -1,22 +1,23 @@
# frozen_string_literal: true
require "queue_classic"
+require "active_support/core_ext/module/redefine_method"
module QC
class Queue
- def enqueue(method, *args)
+ redefine_method(:enqueue) do |method, *args|
receiver_str, _, message = method.rpartition(".")
receiver = eval(receiver_str)
receiver.send(message, *args)
end
- def enqueue_in(seconds, method, *args)
+ redefine_method(:enqueue_in) do |seconds, method, *args|
receiver_str, _, message = method.rpartition(".")
receiver = eval(receiver_str)
receiver.send(message, *args)
end
- def enqueue_at(not_before, method, *args)
+ redefine_method(:enqueue_at) do |not_before, method, *args|
receiver_str, _, message = method.rpartition(".")
receiver = eval(receiver_str)
receiver.send(message, *args)
diff --git a/activejob/test/support/sneakers/inline.rb b/activejob/test/support/sneakers/inline.rb
index 92b69ee3bc..e772c68c6e 100644
--- a/activejob/test/support/sneakers/inline.rb
+++ b/activejob/test/support/sneakers/inline.rb
@@ -1,11 +1,12 @@
# frozen_string_literal: true
require "sneakers"
+require "active_support/core_ext/module/redefine_method"
module Sneakers
module Worker
module ClassMethods
- def enqueue(msg)
+ redefine_method(:enqueue) do |msg|
worker = new(nil, nil, {})
worker.work(*msg)
end