Sha256: 6f3ccaf0ae566cbbf44b8844f8ad909157177657e2d9686c8dbf04906465a5c1
Contents?: true
Size: 941 Bytes
Versions: 8
Compression:
Stored size: 941 Bytes
Contents
RSpec.configure do |config| VERSION_REGEX = /(?<operator>[<>=]+)?\s?(?<version>(\d+.?)+)/m.freeze config.before(:each) do |example| Sidekiq.redis(&:flushdb) Sidekiq::Worker.clear_all if (sidekiq = example.metadata[:sidekiq]) sidekiq = :fake if sidekiq == true Sidekiq::Testing.send("#{sidekiq}!") end sidekiq_ver = example.metadata[:sidekiq_ver] version, operator = VERSION_REGEX.match(sidekiq_ver.to_s) do |m| fail 'Please specify how to compare the version with >= or < or =' unless m[:operator] [m[:version], m[:operator]] end unless Sidekiq::VERSION.send(operator, version) skip('Skipped due to version check (requirement was that sidekiq version is ' \ "#{operator} #{version}; was #{Sidekiq::VERSION})") end if version && operator end config.after(:each) do |example| Sidekiq::Testing.disable! unless example.metadata[:sidekiq].nil? end end
Version data entries
8 entries across 8 versions & 1 rubygems