Sha256: 6bc6c0dd213789c20fbe67622abbd40d7629e03fd31bbee13c811026415f08c0

Contents?: true

Size: 626 Bytes

Versions: 22

Compression:

Stored size: 626 Bytes

Contents

require 'fluent/test'

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

22 entries across 22 versions & 1 rubygems

Version Path
fluentd-0.10.57 test/plugin/test_in_gc_stat.rb
fluentd-0.10.56 test/plugin/test_in_gc_stat.rb
fluentd-0.10.55 test/plugin/test_in_gc_stat.rb
fluentd-0.10.54 test/plugin/test_in_gc_stat.rb
fluentd-0.12.0.pre.1 test/plugin/test_in_gc_stat.rb
fluentd-0.10.53 test/plugin/test_in_gc_stat.rb
fluentd-0.10.52 test/plugin/test_in_gc_stat.rb
fluentd-0.10.51 test/plugin/test_in_gc_stat.rb
fluentd-0.10.50 test/plugin/test_in_gc_stat.rb
fluentd-0.10.49 test/plugin/test_in_gc_stat.rb
fluentd-0.10.48 test/plugin/test_in_gc_stat.rb
fluentd-0.10.47 test/plugin/test_in_gc_stat.rb
fluentd-0.10.46 test/plugin/test_in_gc_stat.rb
fluentd-0.10.45 test/plugin/in_gc_stat.rb
fluentd-0.10.44 test/plugin/in_gc_stat.rb
fluentd-0.10.43 test/plugin/in_gc_stat.rb
fluentd-0.10.42 test/plugin/in_gc_stat.rb
fluentd-0.10.41 test/plugin/in_gc_stat.rb
fluentd-0.10.40 test/plugin/in_gc_stat.rb
fluentd-0.10.39 test/plugin/in_gc_stat.rb