test/plugin/test_out_twitter.rb in fluent-plugin-twitter-0.2.4 vs test/plugin/test_out_twitter.rb in fluent-plugin-twitter-0.3.0
- old
+ new
@@ -6,12 +6,12 @@
end
CONFIG = %[
consumer_key CONSUMER_KEY
consumer_secret CONSUMER_SECRET
- oauth_token OAUTH_TOKEN
- oauth_token_secret OAUTH_TOKEN_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
@@ -21,26 +21,28 @@
d = create_driver('')
}
d = create_driver %[
consumer_key CONSUMER_KEY
consumer_secret CONSUMER_SECRET
- oauth_token OAUTH_TOKEN
- oauth_token_secret OAUTH_TOKEN_SECRET
+ access_token ACCESS_TOKEN
+ access_token_secret ACCESS_TOKEN_SECRET
]
- d.instance.inspect
assert_equal 'CONSUMER_KEY', d.instance.consumer_key
assert_equal 'CONSUMER_SECRET', d.instance.consumer_secret
- assert_equal 'OAUTH_TOKEN', d.instance.oauth_token
- assert_equal 'OAUTH_TOKEN_SECRET', d.instance.oauth_token_secret
+ assert_equal 'ACCESS_TOKEN', d.instance.access_token
+ assert_equal 'ACCESS_TOKEN_SECRET', d.instance.access_token_secret
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
+ 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