spec/integration/twitter_spec.rb in logstash-input-twitter-2.1.0 vs spec/integration/twitter_spec.rb in logstash-input-twitter-2.2.0
- old
+ new
@@ -69,7 +69,38 @@
it "contains the user_mentions" do
expect(event["user_mentions"]).to be_truthy
end
end
+
+ context "when using a proxy" do
+ let(:config) do
+ <<-CONFIG
+ input {
+ twitter {
+ consumer_key => '#{ENV['TWITTER_CONSUMER_KEY']}'
+ consumer_secret => '#{ENV['TWITTER_CONSUMER_SECRET']}'
+ keywords => [ "London", "Barcelona" ]
+ oauth_token => '#{ENV['TWITTER_OAUTH_TOKEN']}'
+ oauth_token_secret => '#{ENV['TWITTER_OAUTH_TOKEN_SECRET']}'
+ full_tweet => true
+ use_proxy => true
+ proxy_address => '127.0.0.1'
+ proxy_port => 8123
+ }
+ }
+ CONFIG
+ end
+
+ let(:events) do
+ input(config) do |pipeline, queue|
+ 3.times.collect { queue.pop }
+ end
+ end
+
+ it "receive a list of events from the twitter stream" do
+ expect(events.count).to eq(3)
+ end
+ end
end
+
end