aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job/test_helper.rb
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-07-20 07:38:26 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-07-20 07:38:26 +0900
commit292be1b7de488fb8c81d65cc68525d1d78f53c67 (patch)
treebf2bb3f48936b8c48ff564031508b07772ce81d2 /activejob/lib/active_job/test_helper.rb
parent526d4b8dc816c17e354e2e0243af16d10147c3f0 (diff)
downloadrails-292be1b7de488fb8c81d65cc68525d1d78f53c67.tar.gz
rails-292be1b7de488fb8c81d65cc68525d1d78f53c67.tar.bz2
rails-292be1b7de488fb8c81d65cc68525d1d78f53c67.zip
Use `ArgumentError` instead of own error class
If the argument is invalid, I think that it is more intuitive to use `ArgumentError` than its own error class.
Diffstat (limited to 'activejob/lib/active_job/test_helper.rb')
-rw-r--r--activejob/lib/active_job/test_helper.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activejob/lib/active_job/test_helper.rb b/activejob/lib/active_job/test_helper.rb
index 2ffedf2999..1cd2c40c15 100644
--- a/activejob/lib/active_job/test_helper.rb
+++ b/activejob/lib/active_job/test_helper.rb
@@ -6,7 +6,6 @@ require "active_support/core_ext/hash/keys"
module ActiveJob
# Provides helper methods for testing Active Job
module TestHelper
- class InvalidOptionsError < StandardError; end
delegate :enqueued_jobs, :enqueued_jobs=,
:performed_jobs, :performed_jobs=,
to: :queue_adapter
@@ -443,7 +442,7 @@ module ActiveJob
end
def validate_option(only: nil, except: nil)
- raise InvalidOptionsError, "Cannot specify both `:only` and `:except` options." if only && except
+ raise ArgumentError, "Cannot specify both `:only` and `:except` options." if only && except
end
end
end