diff options
author | Akira Matsuda <ronnie@dio.jp> | 2017-01-05 17:20:57 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2017-01-05 19:58:52 +0900 |
commit | 5473e390d362755125d2f47b64ef0a135f2fe111 (patch) | |
tree | b9c199a3c78ad307ed034cf5618e2897dfa650c6 /activejob/test | |
parent | 6197a38bca988f05087aa022e288922cf0331d6c (diff) | |
download | rails-5473e390d362755125d2f47b64ef0a135f2fe111.tar.gz rails-5473e390d362755125d2f47b64ef0a135f2fe111.tar.bz2 rails-5473e390d362755125d2f47b64ef0a135f2fe111.zip |
`self.` is not needed when calling its own instance method
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
Diffstat (limited to 'activejob/test')
-rw-r--r-- | activejob/test/cases/queue_naming_test.rb | 2 | ||||
-rw-r--r-- | activejob/test/cases/queue_priority_test.rb | 2 | ||||
-rw-r--r-- | activejob/test/support/sneakers/inline.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/activejob/test/cases/queue_naming_test.rb b/activejob/test/cases/queue_naming_test.rb index 0e1e0decd1..0247bc111e 100644 --- a/activejob/test/cases/queue_naming_test.rb +++ b/activejob/test/cases/queue_naming_test.rb @@ -56,7 +56,7 @@ class QueueNamingTest < ActiveSupport::TestCase original_queue_name = HelloJob.queue_name begin - HelloJob.queue_as { self.arguments.first == "1" ? :one : :two } + HelloJob.queue_as { arguments.first == "1" ? :one : :two } assert_equal "one", HelloJob.new("1").queue_name assert_equal "two", HelloJob.new("3").queue_name ensure diff --git a/activejob/test/cases/queue_priority_test.rb b/activejob/test/cases/queue_priority_test.rb index b0d0e903fc..171fb1e593 100644 --- a/activejob/test/cases/queue_priority_test.rb +++ b/activejob/test/cases/queue_priority_test.rb @@ -32,7 +32,7 @@ class QueuePriorityTest < ActiveSupport::TestCase original_priority = HelloJob.priority begin - HelloJob.queue_with_priority { self.arguments.first == "1" ? 99 : 11 } + HelloJob.queue_with_priority { arguments.first == "1" ? 99 : 11 } assert_equal 99, HelloJob.new("1").priority assert_equal 11, HelloJob.new("3").priority ensure diff --git a/activejob/test/support/sneakers/inline.rb b/activejob/test/support/sneakers/inline.rb index 3cdc54e6d5..cf102ae5c2 100644 --- a/activejob/test/support/sneakers/inline.rb +++ b/activejob/test/support/sneakers/inline.rb @@ -4,7 +4,7 @@ module Sneakers module Worker module ClassMethods def enqueue(msg) - worker = self.new(nil, nil, {}) + worker = new(nil, nil, {}) worker.work(*msg) end end |