Sha256: 15f364cfef35755702be4f84b891a0831dc612e353c961898a7014e4811339a9
Contents?: true
Size: 572 Bytes
Versions: 11
Compression:
Stored size: 572 Bytes
Contents
# frozen_string_literal: true def wait_for(timeout_milliseconds = 2000) timeout = (timeout_milliseconds + 0.0) / 1000 finish = Time.now + timeout Thread.new do sleep(0.001) while Time.now < finish && !yield end.join end def test_config_for_backend(backend) config = { backend: backend } case backend when :redis config[:url] = ENV['REDISURL'] when :postgres config[:backend_options] = { host: ENV['PGHOST'], user: ENV['PGUSER'] || ENV['USER'], password: ENV['PGPASSWORD'], dbname: ENV['PGDATABASE'] || 'message_bus_test' } end config end
Version data entries
11 entries across 11 versions & 1 rubygems