Sha256: db807819b945c65c9733bcbba5164683dd9a794dc0a9ae839176189587255483

Contents?: true

Size: 633 Bytes

Versions: 5

Compression:

Stored size: 633 Bytes

Contents

require_relative '../helper'

class GCStatInputTest < Test::Unit::TestCase
  def setup
    Fluent::Test.setup
  end

  CONFIG = %[
    emit_interval 1
    tag t1
  ]

  def create_driver(conf=CONFIG)
    Fluent::Test::InputTestDriver.new(Fluent::GCStatInput).configure(conf)
  end

  def test_configure
    d = create_driver
    assert_equal(1, d.instance.emit_interval)
    assert_equal("t1", d.instance.tag)
  end

  def test_emit
    stat = GC.stat
    stub(GC).stat { stat }

    d = create_driver
    d.run do
      sleep 2
    end

    emits = d.emits
    assert(emits.length > 0)
    assert_equal(stat, emits[0][2])
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fluentd-0.10.62 test/plugin/test_in_gc_stat.rb
fluentd-0.10.61 test/plugin/test_in_gc_stat.rb
fluentd-0.10.60 test/plugin/test_in_gc_stat.rb
fluentd-0.10.59 test/plugin/test_in_gc_stat.rb
fluentd-0.10.58 test/plugin/test_in_gc_stat.rb