Skip to content

Commit

Permalink
fixed faulty optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
voloko committed Oct 4, 2010
1 parent 08601d0 commit 83af14d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/twitter/json_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def send_request

content = @options[:content]

unless q = query.empty?
unless (q = query).empty?
if @options[:method].to_s.upcase == 'GET'
request_uri << "?#{q}"
else
Expand Down
10 changes: 10 additions & 0 deletions spec/twitter/json_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ def receive_data data
$close_connection = false
end

it "should add no params" do
connect_stream
$recieved_data.should include('/1/statuses/filter.json HTTP')
end

it "should add custom params" do
connect_stream :params => {:name => 'test'}
$recieved_data.should include('?name=test')
end

it "should parse headers" do
connect_stream
stream.code.should == 200
Expand Down

0 comments on commit 83af14d

Please sign in to comment.