Sha256: 02c33b60a5fb781734eb630d6915a6363670564caea362c7291cc310ecca4b00

Contents?: true

Size: 922 Bytes

Versions: 2

Compression:

Stored size: 922 Bytes

Contents

RSpec.configure do |config|
  config.before(:each) do |example|
    SidekiqUniqueJobs.configure do |c|
      c.redis_test_mode = :redis
    end

    if (sidekiq = example.metadata[:sidekiq])
      sidekiq = :fake if sidekiq == true
      Sidekiq::Testing.send("#{sidekiq}!")
    end

    if (sidekiq_ver = example.metadata[:sidekiq_ver])
      VERSION_REGEX.match(sidekiq_ver.to_s) do |match|
        version  = match[:version]
        operator = match[:operator]

        raise 'Please specify how to compare the version with >= or < or =' unless operator

        unless Sidekiq::VERSION.send(operator, version)
          skip('Skipped due to version check (requirement was that sidekiq version is ' \
               "#{operator} #{version}; was #{Sidekiq::VERSION})")
        end
      end
    end
  end

  config.after(:each) do |example|
    Sidekiq::Testing.disable! unless example.metadata[:sidekiq].nil?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-5.0.1 spec/support/sidekiq_meta.rb
sidekiq-unique-jobs-5.0.0 spec/support/sidekiq_meta.rb