Sha256: 985701997b15649a6ebadb5c2b41c63acf3f7bc7ec9babbca4476ada3290ecc7

Contents?: true

Size: 696 Bytes

Versions: 47

Compression:

Stored size: 696 Bytes

Contents

require_relative '../helper'
require 'fluent/test'

class StatusInputTest < 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::StatusInput).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
    stub(Fluent::Status).each { |b|
      b.call("answer" => "42")
    }

    d = create_driver
    d.run do
      sleep 2
    end

    emits = d.emits
    assert(emits.length > 0)
    assert_equal({"answer" => "42"}, emits[0][2])
  end
end

Version data entries

47 entries across 47 versions & 2 rubygems

Version Path
fluentd-0.12.43 test/plugin/test_in_status.rb
fluentd-0.12.42 test/plugin/test_in_status.rb
fluentd-0.12.41 test/plugin/test_in_status.rb
fluentd-0.12.40 test/plugin/test_in_status.rb
fluentd-0.12.39 test/plugin/test_in_status.rb
fluentd-0.12.38 test/plugin/test_in_status.rb
fluentd-0.12.37 test/plugin/test_in_status.rb
fluentd-0.12.36 test/plugin/test_in_status.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/fluentd-0.12.35/test/plugin/test_in_status.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/fluentd-0.12.35/test/plugin/test_in_status.rb
fluentd-0.12.35 test/plugin/test_in_status.rb
fluentd-0.12.34 test/plugin/test_in_status.rb
fluentd-0.12.33 test/plugin/test_in_status.rb
fluentd-0.12.32 test/plugin/test_in_status.rb
fluentd-0.12.31 test/plugin/test_in_status.rb
fluentd-0.12.30 test/plugin/test_in_status.rb
fluentd-0.12.29 test/plugin/test_in_status.rb
fluentd-0.12.28 test/plugin/test_in_status.rb
fluentd-0.12.27 test/plugin/test_in_status.rb
fluentd-0.12.26 test/plugin/test_in_status.rb