Skip to content

Commit

Permalink
Use 'tude' parameter for attitudes
Browse files Browse the repository at this point in the history
  • Loading branch information
alindeman authored and sferik committed Dec 30, 2010
1 parent b115038 commit 8db1bf9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions lib/twitter/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def clear
@cache = nil
@query = {}
@query[:q] = []
@query[:tude] = []
self
end

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions spec/twitter/search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8db1bf9

Please sign in to comment.