0.01
No commit activity in last 3 years
No release in over 3 years
Testing support fot the Que queue
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 5.4
~> 10.0

Runtime

>= 0
 Project Readme

que-testing Build Status

Testing support for the Que queue. que-testing allows you to enqueue jobs without a database and without synchronous running.

Installation

Add this line to your application's Gemfile:

gem 'que-testing', :require => false

And then execute:

$ bundle

Or install it yourself as:

$ gem install que-testing

Usage

In your test, require 'que/testing' and enqueue jobs as normal. Jobs are stored under a MyJob.jobs array. Because they're static, the stored jobs should be cleared between test runs.

require "que/testing"

describe "Testing" do
  after { MyJob.jobs.clear }

  it "Stores a job" do
    MyJob.enqueue("foo")

    js = MyJob.jobs
    js.length.must_equal 1
    js.first["args"].must_equal ["foo"]
    js.first["job_class"].must_equal "MyJob"
  end
end