Sha256: 51a7007d09f4834ed8da5af9e3750acf25aafa9fce49fcff00183318fe7a2df6

Contents?: true

Size: 818 Bytes

Versions: 2

Compression:

Stored size: 818 Bytes

Contents

require 'open3'
require 'rack/test'
require 'timecop'
require 'thread'

require_relative 'support/threading_matchers'
require_relative 'support/http_helpers'

Thread.abort_on_exception = true # ensure no exception stays hidden in threads

ENV['RACK_ENV'] = 'test'
require_relative '../lib/pubsubstub'

Pubsubstub.logger = Logger.new(nil)
Pubsubstub.logger.level = Logger::DEBUG

RSpec.configure do |config|
  config.include Rack::Test::Methods
  config.include HTTPHelpers

  config.run_all_when_everything_filtered = true
  config.filter_run :focus
  config.color = true

  config.order = 'random'

  config.before(:each) { Redis.new(url: Pubsubstub.redis_url).flushdb }

  # Clean threads after finish
  config.after(:each) do
    Thread.list.each { |thread| thread.join(0.5) if thread != Thread.current }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pubsubstub-0.3.0 spec/spec_helper.rb
pubsubstub-0.2.2 spec/spec_helper.rb