Sha256: b290c1a23992bde7ec6f05bec09600dd68f32e585a8ebede5366048ebb268c82

Contents?: true

Size: 867 Bytes

Versions: 7

Compression:

Stored size: 867 Bytes

Contents

require 'helper'

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

  CONFIG = %[
    ga_account MO-1234567-1
    set_var    agent
  ]

  def create_driver(conf=CONFIG,tag='test')
    Fluent::Test::OutputTestDriver.new(Fluent::GamobileOutput, tag).configure(conf)
  end

  def test_configure
    assert_raise(Fluent::ConfigError) {
      d = create_driver('')
    }
    d = create_driver %[
      ga_account MO-1234567-1
      set_var    agent
    ]
    d.instance.inspect
    assert_equal 'MO-1234567-1', d.instance.ga_account
    assert_equal 'agent', d.instance.set_var
  end

  def test_emit
    d1 = create_driver(CONFIG, 'input.access')
    time = Time.parse("2012-01-02 13:14:15").to_i
    d1.run do
      d1.emit({'message' => 'sample message'})
    end
    emits = d1.emits
    assert_equal 0, emits.length
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fluent-plugin-gamobile-0.3.0 test/plugin/test_out_gamobile.rb
fluent-plugin-gamobile-0.2.4 test/plugin/test_out_gamobile.rb
fluent-plugin-gamobile-0.2.3 test/plugin/test_out_gamobile.rb
fluent-plugin-gamobile-0.2.2 test/plugin/test_out_gamobile.rb
fluent-plugin-gamobile-0.2.1 test/plugin/test_out_gamobile.rb
fluent-plugin-gamobile-0.1.1 test/plugin/test_out_gamobile.rb
fluent-plugin-gamobile-0.0.1 test/plugin/test_out_gamobile.rb