Sha256: 25108b58d196e25a997ff305c777b0245679cbe96a864b20951d111c87c91222
Contents?: true
Size: 1002 Bytes
Versions: 1
Compression:
Stored size: 1002 Bytes
Contents
# frozen_string_literal: true require 'sidekiq/testing' RSpec.configure do |config| config.before(:each, :queue => lambda { |v| !!v }) do |example| # Clears out the jobs for tests using the fake testing Sidekiq::Worker.clear_all Sidekiq::Queues.clear_all Sidekiq.redis do |client| connection = client.__send__(:instance_variable_get, :@redis) || client.__send__(:instance_variable_get, :@client) connection.call([:flushdb]) end 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 [:system, :feature].include?(example.metadata[:type]) Sidekiq::Testing.inline! else Sidekiq::Testing.fake! end end config.after(:each, :queue => lambda { |v| !!v }) do |_example| Sidekiq::Testing.fake! end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rspeckled-1.0.3 | lib/rspeckled/plugins/sidekiq.rb |