diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-07-20 07:38:26 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-07-20 07:38:26 +0900 |
commit | 292be1b7de488fb8c81d65cc68525d1d78f53c67 (patch) | |
tree | bf2bb3f48936b8c48ff564031508b07772ce81d2 /activejob/lib/active_job/test_helper.rb | |
parent | 526d4b8dc816c17e354e2e0243af16d10147c3f0 (diff) | |
download | rails-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.rb | 3 |
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 |