Sha256: 11293db7a5dc1ed00cc73d2d64d5a1eb4c9cffb196c36bde606625d5408afb59

Contents?: true

Size: 632 Bytes

Versions: 1

Compression:

Stored size: 632 Bytes

Contents

require 'bundler/setup'
require 'rspec'
require 'fwd'

module Fwd::TestHelper

  def with_em
    EM.run do
      begin
        yield
      ensure
        EM.stop
      end
    end
  end

  def root
    @_root ||= Pathname.new File.expand_path("../../tmp", __FILE__)
  end

  def core
    @_core ||= Fwd.new \
      path: root,
      flush_rate: 20,
      buffer_limit: 2048,
      forward: ["tcp://127.0.0.1:7291", "tcp://127.0.0.1:7292"]
  end

end

RSpec.configure do |c|
  c.include(Fwd::TestHelper)
  c.before(:suite) do
    Fwd.logger = Logger.new("/dev/null")
  end
  c.before(:each) do
    FileUtils.rm_rf root.to_s
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fwd-0.3.2 spec/spec_helper.rb