Sha256: 651c4169416ccd6f95dfa9a4f8ba1c73ca15ac5c8d1f413bdb8e234d4b9534bd

Contents?: true

Size: 740 Bytes

Versions: 2

Compression:

Stored size: 740 Bytes

Contents

# frozen_string_literal: true
begin
  require 'sidekiq/testing'

  RSpec.configure do |config|
    config.before(:each) do |example|
      # Clears out the jobs for tests using the fake testing
      Sidekiq::Worker.clear_all
      Sidekiq::Queues.clear_all
      Sidekiq.redis(&:flushdb)
      Sidekiq.redis do |client|
        client.keys.each do |key|
          client.del(key)
        end
      end

      if example.metadata[:queue] == :stub
        Sidekiq::Testing.fake!
      elsif example.metadata[:queue] == :immediately_execute
        Sidekiq::Testing.inline!
      elsif example.metadata[:type] == :feature
        Sidekiq::Testing.inline!
      else
        Sidekiq::Testing.fake!
      end
    end
  end
rescue LoadError
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspeckled-0.0.19 lib/rspeckled/plugins/sidekiq.rb
rspeckled-0.0.18 lib/rspeckled/plugins/sidekiq.rb