Sha256: c4197942282255a4072181f23873525aec7e3b7a593f9d6aaa1e8d63f138bef4

Contents?: true

Size: 1.11 KB

Versions: 10

Compression:

Stored size: 1.11 KB

Contents

require 'rubygems'
require 'bundler'
Bundler.setup

require 'codeclimate-test-reporter'
SimpleCov.start do
  formatter SimpleCov::Formatter::MultiFormatter.new([
    SimpleCov::Formatter::HTMLFormatter,
    CodeClimate::TestReporter::Formatter
  ])
  add_filter '/spec/'
end

require 'pry'
require 'securerandom'
require 'freddy'
require 'logger'
require 'hamster/experimental/mutable_set'

Thread.abort_on_exception = true

RSpec.configure do |config|
  config.run_all_when_everything_filtered = true
  config.filter_run :focus
  config.order = 'random'
end

def random_destination
  SecureRandom.hex
end

def default_sleep
  sleep 0.05
end

def wait_for(&block)
  100.times do
    return if block.call
    sleep 0.005
  end
end

def deliver(custom_destination = destination)
  freddy.deliver custom_destination, payload
  default_sleep
end

def logger
  Logger.new(STDOUT).tap { |l| l.level = Logger::ERROR }
end

def config
  {host: 'localhost', port: 5672, user: 'guest', pass: 'guest'}
end

def spawn_echo_responder(freddy, queue_name)
  freddy.respond_to queue_name do |payload, msg_handler|
    msg_handler.success(payload)
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
freddy-0.6.3 spec/spec_helper.rb
freddy-0.6.2 spec/spec_helper.rb
freddy-0.6.1 spec/spec_helper.rb
freddy-jruby-0.6.0 spec/spec_helper.rb
freddy-0.6.0 spec/spec_helper.rb
freddy-0.5.8 spec/spec_helper.rb
freddy-0.5.7 spec/spec_helper.rb
freddy-jruby-0.5.6 spec/spec_helper.rb
freddy-0.5.6 spec/spec_helper.rb
freddy-0.5.5 spec/spec_helper.rb