in your spec_helper add the following line
require 'little_monster/rspec'
it takes a job and a hash of parameters and returns a fully configured job instance
generate_job :my_job, data: { a: :b }
generate_job :my_job, data: { a: :b }, fails: { task: :my_task, error: MyError.new }
generate_job :my_job, data: { a: :b }, fails: [{ task: :my_task, error: MyError.new }, { task: :my_other_task, error: MyError.new }]
given a generated job, it returns a JobResult object to make expectation about the run
it takes a task class or symbol and returns a fully configured task instance
generate_task MyJob::MyTask, data: { a: :b }
given a JobResult object expects the job to run that list of tasks
expect(run_job(:my_job)).to have_run(:my_task, :my_other_task)
given a JobResult object expects the job to run the a given task with a certain data
expect(run_job(:my_job)).to have_run_task(:my_task).with_data(a: :b)
given a JobResult object expects the job have a given status after the run
expect(run_job(:my_job)).to have_ended_with_status(:success)
given checks a job or JobResult instance data
expect(run_job(:my_job)).to have_ended_with_status(:success)
expect(generate_job(:my_job)).to have_ended_with_status(:success)
given job instance, a class or a class symbol it expects the retries for that class
expect(:my_job).to have_retries(3)
given job instance, a class or a class symbol it expects the callback retries for that class
expect(my_job).to have_callback_retries(10)