Sha256: 41b3e870f78fb5988db42de5eb6dac78996da4be6035b8fb4361d0e641e202ce

Contents?: true

Size: 1.15 KB

Versions: 346

Compression:

Stored size: 1.15 KB

Contents

require 'test/unit/assertions'

module Test::Unit::Assertions
  def assert_text_parsed_as(expected, actual)
    msg = parse_text(actual).inspect rescue 'failed'
    msg = "expected that #{actual.inspect} would be a parsed as #{expected.inspect} but got #{msg}"
    assert_block(msg) {
      v = parse_text(actual)
      if expected.is_a?(Float)
        v.is_a?(Float) && (v == obj || (v.nan? && obj.nan?) || (v - obj).abs < 0.000001)
      else
        v == expected
      end
    }
  end

  def assert_text_parsed_as_json(expected, actual)
    msg = parse_text(actual).inspect rescue 'failed'
    msg = "expected that #{actual.inspect} would be a parsed as #{expected.inspect} but got #{msg}"
    assert_block(msg) {
      v = JSON.parse(parse_text(actual))
      v == expected
    }
  end

  def assert_parse_error(actual)
    msg = begin
            parse_text(actual).inspect
          rescue => e
            e.inspect
          end
    msg = "expected that #{actual.inspect} would cause a parse error but got #{msg}"
    assert_block(msg) {
      begin
        parse_text(actual)
        false
      rescue Fluent::ConfigParseError
        true
      end
    }
  end
end

Version data entries

346 entries across 346 versions & 9 rubygems

Version Path
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/config/assertions.rb
fluentd-1.16.6-x86-mingw32 test/config/assertions.rb
fluentd-1.16.6-x64-mingw32 test/config/assertions.rb
fluentd-1.16.6-x64-mingw-ucrt test/config/assertions.rb
fluentd-1.16.6 test/config/assertions.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/config/assertions.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/config/assertions.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/config/assertions.rb
fluentd-1.17.0-x86-mingw32 test/config/assertions.rb
fluentd-1.17.0-x64-mingw-ucrt test/config/assertions.rb
fluentd-1.17.0-x64-mingw32 test/config/assertions.rb
fluentd-1.17.0 test/config/assertions.rb
fluentd-1.16.5-x64-mingw-ucrt test/config/assertions.rb
fluentd-1.16.5-x86-mingw32 test/config/assertions.rb
fluentd-1.16.5-x64-mingw32 test/config/assertions.rb
fluentd-1.16.5 test/config/assertions.rb
fluentd-1.16.4-x64-mingw-ucrt test/config/assertions.rb
fluentd-1.16.4-x86-mingw32 test/config/assertions.rb
fluentd-1.16.4-x64-mingw32 test/config/assertions.rb
fluentd-1.16.4 test/config/assertions.rb