Sha256: 0f7a27bd09455792650b38f7b513cc4164cfc28b1566c0a97eb2c723aa25be58

Contents?: true

Size: 302 Bytes

Versions: 12

Compression:

Stored size: 302 Bytes

Contents

module DelayedJobSpecHelper
  def with_jobs_delayed(opts = {})
    work_off = opts.fetch(:work_off, true)
    original = Delayed::Worker.delay_jobs
    Delayed::Worker.delay_jobs = true
    yield
  ensure
    Delayed::Worker.delay_jobs = original
    Delayed::Worker.new.work_off if work_off
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
journaled-2.5.0 spec/support/delayed_job_spec_helper.rb
journaled-2.4.0 spec/support/delayed_job_spec_helper.rb
journaled-2.3.1 spec/support/delayed_job_spec_helper.rb
journaled-2.3.0 spec/support/delayed_job_spec_helper.rb
journaled-2.2.0 spec/support/delayed_job_spec_helper.rb
journaled-2.1.1 spec/support/delayed_job_spec_helper.rb
journaled-2.1.0 spec/support/delayed_job_spec_helper.rb
journaled-2.0.3 spec/support/delayed_job_spec_helper.rb
journaled-2.0.2 spec/support/delayed_job_spec_helper.rb
journaled-2.0.1 spec/support/delayed_job_spec_helper.rb
journaled-2.0.0 spec/support/delayed_job_spec_helper.rb
journaled-2.0.0.rc1 spec/support/delayed_job_spec_helper.rb