Sha256: c4f276177cfcf3db0d66763e4e1904aefff48755294068f1181809314fbea928

Contents?: true

Size: 655 Bytes

Versions: 47

Compression:

Stored size: 655 Bytes

Contents

require_relative '../helper'
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

47 entries across 47 versions & 2 rubygems

Version Path
fluentd-0.12.25 test/plugin/test_in_gc_stat.rb
fluentd-0.12.24 test/plugin/test_in_gc_stat.rb
fluentd-0.12.23 test/plugin/test_in_gc_stat.rb
fluentd-0.12.22 test/plugin/test_in_gc_stat.rb
fluentd-0.12.21 test/plugin/test_in_gc_stat.rb
fluentd-0.12.20 test/plugin/test_in_gc_stat.rb
fluentd-0.12.19 test/plugin/test_in_gc_stat.rb
fluentd-0.12.18 test/plugin/test_in_gc_stat.rb
fluentd-0.12.17 test/plugin/test_in_gc_stat.rb
fluentd-0.12.16 test/plugin/test_in_gc_stat.rb
fluentd-0.12.15 test/plugin/test_in_gc_stat.rb
fluentd-0.12.14 test/plugin/test_in_gc_stat.rb
fluentd-0.12.13 test/plugin/test_in_gc_stat.rb
fluentd-0.12.12 test/plugin/test_in_gc_stat.rb
fluentd-0.12.11 test/plugin/test_in_gc_stat.rb
fluentd-0.12.10 test/plugin/test_in_gc_stat.rb
fluentd-0.12.9 test/plugin/test_in_gc_stat.rb
fluentd-0.12.8 test/plugin/test_in_gc_stat.rb
fluentd-0.12.7 test/plugin/test_in_gc_stat.rb
fluentd-0.12.6 test/plugin/test_in_gc_stat.rb