Module: Arj::Test
- Includes:
- Query
- Defined in:
- lib/arj/test/support.rb
Overview
Arj testing module. Provides job classes for use in tests.
See:
-
Job - A test job.
-
Error - A test error which, when raised from a test job, will cause the job to be retried.
-
JobWithShard - A test job with an added
shard
column. -
JobWithLastError - A test job with an added
last_error
column.
Defined Under Namespace
Classes: Error, Job, JobWithLastError, JobWithShard
Class Method Summary collapse
-
.all ⇒ Object
Overrides Query::ClassMethods#all to provide a scope for test jobs.
Methods included from Query
Class Method Details
.all ⇒ Object
Overrides Query::ClassMethods#all to provide a scope for test jobs.
Example usage:
Arj::Test::Job.perform_later
Arj::Test.available.first # Returns next available test job
Arj::Test.where(executions: 0).count # Returns the number of test jobs which have never been executed.
25 26 27 |
# File 'lib/arj/test/support.rb', line 25 def self.all Arj.where(job_class: [Job].map(&:name)) end |