Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: lukemelia/weeter
base: c82c6b9398
...
head fork: lukemelia/weeter
compare: 619f22df2f
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
7 lib/weeter/twitter/tweet_consumer.rb
@@ -46,15 +46,16 @@ def reconnect(filter_params)
end
protected
-
+
def clean_filter_params(p)
return {} if p.nil?
cleaned_params = {}
cleaned_params['follow'] = p['follow'] if (p['follow'] || []).any?
+ cleaned_params['follow'] = cleaned_params['follow'].map(&:to_i)
cleaned_params['track'] = p['track'] if (p['track'] || []).any?
cleaned_params
end
-
+
def ignore_tweet(tweet_item)
id = tweet_item['id_str']
text = tweet_item['text']
@@ -64,4 +65,4 @@ def ignore_tweet(tweet_item)
end
end
-end
View
2  lib/weeter/version.rb
@@ -1,3 +1,3 @@
module Weeter
- VERSION = "0.9.1"
+ VERSION = "0.9.2"
end
View
12 spec/weeter/twitter/tweet_consumer_spec.rb
@@ -27,7 +27,7 @@
@client_proxy = mock('NotificationPlugin', :publish_tweet => nil)
@consumer = Weeter::Twitter::TweetConsumer.new(Weeter::Configuration::TwitterConfig.instance, @client_proxy)
end
-
+
after(:each) do
@consumer.connect(@filter_params)
end
@@ -39,21 +39,21 @@
it "should connect to a Twitter JSON stream" do
Twitter::JSONStream.should_receive(:connect).
- with(:ssl => true, :foo => :bar, :params => @filter_params, :method => 'POST')
+ with(:ssl => true, :foo => :bar, :params => {'follow' => [1,2,3]}, :method => 'POST')
end
-
+
it "should publish new tweet if publishable" do
mock_tweet = mock('tweet', :deletion? => false, :publishable? => true)
tweet_item = Weeter::TweetItem.stub!(:new).and_return mock_tweet
@client_proxy.should_receive(:publish_tweet).with(mock_tweet)
end
-
+
it "should not publish unpublishable tweets" do
mock_tweet = mock('tweet', :deletion? => false, :publishable? => false, :[] => '')
tweet_item = Weeter::TweetItem.stub!(:new).and_return mock_tweet
@client_proxy.should_not_receive(:publish_tweet).with(mock_tweet)
end
-
+
it "should delete deletion tweets" do
mock_tweet = mock('tweet', :deletion? => true, :publishable? => false)
tweet_item = Weeter::TweetItem.stub!(:new).and_return mock_tweet
@@ -61,4 +61,4 @@
end
end
-end

No commit comments for this range

Something went wrong with that request. Please try again.