Sha256: 72bf7a178e1c6d351f7359e277b8bcef68046acadc57fc0a124c94cada4ea79d

Contents?: true

Size: 799 Bytes

Versions: 1

Compression:

Stored size: 799 Bytes

Contents

require 'spec_helper'

describe QueueClassicMatchers do
  class TestJob < QueueClassicPlus::Base
    @queue = :low
    def self.perform
    end
  end

  describe 'have_queued' do
    it 'works with no arguments' do
      expect(TestJob).to_not have_queued
      TestJob.do
      expect(TestJob).to have_queued
    end

    it 'works wiht argument' do
      expect(TestJob).to_not have_queued(1)
      TestJob.do 1
      expect(TestJob).to have_queued(1)
      expect(TestJob).to_not have_queued(2)
    end
  end

  describe 'have_queue_size_of' do
    it 'works' do
      expect(TestJob).to have_queue_size_of(0)
      expect(TestJob).to_not have_queue_size_of(1)

      TestJob.do

      expect(TestJob).to have_queue_size_of(1)
      expect(TestJob).to_not have_queue_size_of(0)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
queue_classic_matchers-1.0.2 spec/queue_classic_matchers_spec.rb