Sha256: 0a23eb2fab9d39021a3552c8eb584b33f77c733e529b0ba4b98ae976af17186d

Contents?: true

Size: 1.42 KB

Versions: 11

Compression:

Stored size: 1.42 KB

Contents

require 'helper'

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

  CONFIG = %[
    consumer_key        CONSUMER_KEY
    consumer_secret     CONSUMER_SECRET
    access_token        ACCESS_TOKEN
    access_token_secret ACCESS_TOKEN_SECRET
  ]

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

  def test_configure
    assert_raise(Fluent::ConfigError) {
      d = create_driver('')
    }
    d = create_driver %[
      consumer_key        CONSUMER_KEY
      consumer_secret     CONSUMER_SECRET
      access_token        ACCESS_TOKEN
      access_token_secret ACCESS_TOKEN_SECRET
    ]
    assert_equal 'CONSUMER_KEY', d.instance.consumer_key
    assert_equal 'CONSUMER_SECRET', d.instance.consumer_secret
    assert_equal 'ACCESS_TOKEN', d.instance.access_token
    assert_equal 'ACCESS_TOKEN_SECRET', d.instance.access_token_secret
  end

  def test_configure_compatible
    d = create_driver %[
      consumer_key        CONSUMER_KEY
      consumer_secret     CONSUMER_SECRET
      oauth_token         ACCESS_TOKEN
      oauth_token_secret  ACCESS_TOKEN_SECRET
    ]
    assert_equal 'CONSUMER_KEY', d.instance.consumer_key
    assert_equal 'CONSUMER_SECRET', d.instance.consumer_secret
    assert_equal 'ACCESS_TOKEN', d.instance.access_token
    assert_equal 'ACCESS_TOKEN_SECRET', d.instance.access_token_secret
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fluent-plugin-twitter-0.6.0 test/plugin/test_out_twitter.rb
fluent-plugin-twitter-0.5.4 test/plugin/test_out_twitter.rb
fluent-plugin-twitter-0.5.3 test/plugin/test_out_twitter.rb
fluent-plugin-twitter-0.5.2 test/plugin/test_out_twitter.rb
fluent-plugin-twitter-0.5.1 test/plugin/test_out_twitter.rb
fluent-plugin-twitter-0.5.0 test/plugin/test_out_twitter.rb
fluent-plugin-twitter-0.4.1 test/plugin/test_out_twitter.rb
fluent-plugin-twitter-0.4.0 test/plugin/test_out_twitter.rb
fluent-plugin-twitter-0.3.2 test/plugin/test_out_twitter.rb
fluent-plugin-twitter-0.3.1 test/plugin/test_out_twitter.rb
fluent-plugin-twitter-0.3.0 test/plugin/test_out_twitter.rb