Sha256: 7067521cd58f725d67938d1003cb229205f63e90ab93da5a4aaaca12751fdf49

Contents?: true

Size: 1.35 KB

Versions: 16

Compression:

Stored size: 1.35 KB

Contents

# simplecov must be loaded before any of target code
if ENV['SIMPLE_COV']
  require 'simplecov'
  if defined?(SimpleCov::SourceFile)
    mod = SimpleCov::SourceFile
    def mod.new(*args, &block)
      m = allocate
      m.instance_eval do
        begin
          initialize(*args, &block)
        rescue Encoding::UndefinedConversionError
          @src = "".force_encoding('UTF-8')
        end
      end
      m
    end
  end
  unless SimpleCov.running
    SimpleCov.start do
      add_filter '/test/'
      add_filter '/gems/'
    end
  end
end

# Some tests use Hash instead of Element for configure.
# We should rewrite these tests in the future and remove this ad-hoc code
class Hash
  def corresponding_proxies
    @corresponding_proxies ||= []
  end

  def to_masked_element
    self
  end
end

require 'rr'
require 'test/unit'
require 'test/unit/rr'
require 'fileutils'
require 'fluent/log'
require 'fluent/test'
require 'fluent/test/helpers'

unless defined?(Test::Unit::AssertionFailedError)
  class Test::Unit::AssertionFailedError < StandardError
  end
end

include Fluent::Test::Helpers

def unused_port
  s = TCPServer.open(0)
  port = s.addr[1]
  s.close
  port
end

def ipv6_enabled?
  require 'socket'

  begin
    TCPServer.open("::1", 0)
    true
  rescue
    false
  end
end

$log = Fluent::Log.new(Fluent::Test::DummyLogDevice.new, Fluent::Log::LEVEL_WARN)

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
fluentd-0.12.43 test/helper.rb
fluentd-0.12.42 test/helper.rb
fluentd-0.12.41 test/helper.rb
fluentd-0.12.40 test/helper.rb
fluentd-0.12.39 test/helper.rb
fluentd-0.12.38 test/helper.rb
fluentd-0.12.37 test/helper.rb
fluentd-0.12.36 test/helper.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/fluentd-0.12.35/test/helper.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/fluentd-0.12.35/test/helper.rb
fluentd-0.12.35 test/helper.rb
fluentd-0.12.34 test/helper.rb
fluentd-0.12.33 test/helper.rb
fluentd-0.12.32 test/helper.rb
fluentd-0.12.31 test/helper.rb
fluentd-0.12.30 test/helper.rb