Name: fury-little_monster-gem
Owner: MercadoLibre
Description: null
Created: 2016-06-13 17:14:55.0
Updated: 2018-05-17 13:53:45.0
Pushed: 2017-11-28 19:09:16.0
Homepage: null
Size: 384
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
in your spec_helper add the following line
ire 'little_monster/rspec'
it takes a job and a hash of parameters and returns a fully configured job instance
rate_job :my_job, data: { a: :b }
rate_job :my_job, data: { a: :b }, fails: { task: :my_task, error: MyError.new }
rate_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
rate_task MyJob::MyTask, data: { a: :b }
given a JobResult object expects the job to run that list of tasks
ct(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
ct(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
ct(run_job(:my_job)).to have_ended_with_status(:success)
given checks a job or JobResult instance data
ct(run_job(:my_job)).to have_ended_with_status(:success)
ct(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
ct(:my_job).to have_retries(3)
given job instance, a class or a class symbol it expects the callback retries for that class
ct(my_job).to have_callback_retries(10)