spec/spec_helper.rb in gush-2.0.2 vs spec/spec_helper.rb in gush-2.1.0

- old
+ new

@@ -1,7 +1,6 @@ require 'gush' -require 'fakeredis' require 'json' require 'pry' ActiveJob::Base.queue_adapter = :test ActiveJob::Base.logger = nil @@ -33,16 +32,12 @@ def configure(param) run Prepare if param end end -class Redis - def publish(*) - end -end -REDIS_URL = "redis://localhost:6379/12" +REDIS_URL = ENV["REDIS_URL"] || "redis://localhost:6379/12" module GushHelpers def redis @redis ||= Redis.new(url: REDIS_URL) end @@ -102,14 +97,15 @@ config.before(:each) do clear_enqueued_jobs clear_performed_jobs Gush.configure do |config| - config.redis_url = REDIS_URL - config.gushfile = GUSHFILE + config.redis_url = REDIS_URL + config.gushfile = GUSHFILE + config.locking_duration = defined?(locking_duration) ? locking_duration : 2 + config.polling_interval = defined?(polling_interval) ? polling_interval : 0.3 end end - config.after(:each) do clear_enqueued_jobs clear_performed_jobs redis.flushdb