Sha256: f79cdffb42fd75f32672daf83aec489f09dd76b2efd227a282a5769713a87572

Contents?: true

Size: 747 Bytes

Versions: 2

Compression:

Stored size: 747 Bytes

Contents

# que-testing

Testing support for the [Que](https://github.com/chanks/que) queue

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'que-testing'
```

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.

```ruby
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
```

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
que-testing-0.1.1 README.md
que-testing-0.1.0 README.md