Browse files

Use 'tude' parameter for attitudes

  • Loading branch information...
1 parent b115038 commit 8db1bf9dadec3a660a281c94cab2fc335891ce30 @alindeman alindeman committed with Dec 30, 2010
Showing with 7 additions and 6 deletions.
  1. +4 −3 lib/twitter/search.rb
  2. +3 −3 spec/twitter/search_spec.rb
View
7 lib/twitter/search.rb
@@ -42,6 +42,7 @@ def clear
@cache = nil
@query = {}
@query[:q] = []
+ @query[:tude] = []
self
end
@@ -133,7 +134,7 @@ def until_date(date)
# @example Return an array of tweets containing happy emoticons
# Twitter::Search.new.positive.fetch
def positive
- @query[:q] << ":)"
+ @query[:tude] << ":)"
self
end
@@ -143,7 +144,7 @@ def positive
# @example Return an array of tweets containing sad emoticons
# Twitter::Search.new.negative.fetch
def negative
- @query[:q] << ":("
+ @query[:tude] << ":("
self
end
@@ -153,7 +154,7 @@ def negative
# @example Return an array of tweets containing question marks
# Twitter::Search.new.question.fetch
def question
- @query[:q] << "?"
+ @query[:tude] << "?"
self
end
View
6 spec/twitter/search_spec.rb
@@ -261,23 +261,23 @@
describe ".positive" do
it "should set the query to include ':)'" do
- @client.positive.query[:q].should include ':)'
+ @client.positive.query[:tude].should include ':)'
end
end
describe ".negative" do
it "should set the query to include ':('" do
- @client.negative.query[:q].should include ':('
+ @client.negative.query[:tude].should include ':('
end
end
describe ".question" do
it "should set the query to include '?'" do
- @client.question.query[:q].should include '?'
+ @client.question.query[:tude].should include '?'
end
end

0 comments on commit 8db1bf9

Please sign in to comment.