Sha256: 98d7fc8ea65ec324b9f9f3ee96e0865339419c77b731dda12af6903a64e57f14

Contents?: true

Size: 1.29 KB

Versions: 19

Compression:

Stored size: 1.29 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'

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

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

19 entries across 19 versions & 1 rubygems

Version Path
fluentd-0.12.29 test/helper.rb
fluentd-0.12.28 test/helper.rb
fluentd-0.12.27 test/helper.rb
fluentd-0.12.26 test/helper.rb
fluentd-0.12.25 test/helper.rb
fluentd-0.12.24 test/helper.rb
fluentd-0.12.23 test/helper.rb
fluentd-0.12.22 test/helper.rb
fluentd-0.12.21 test/helper.rb
fluentd-0.12.20 test/helper.rb
fluentd-0.12.19 test/helper.rb
fluentd-0.12.18 test/helper.rb
fluentd-0.12.17 test/helper.rb
fluentd-0.12.16 test/helper.rb
fluentd-0.12.15 test/helper.rb
fluentd-0.12.14 test/helper.rb
fluentd-0.12.13 test/helper.rb
fluentd-0.12.12 test/helper.rb
fluentd-0.12.11 test/helper.rb