Skip to content

Commit

Permalink
Added blocked_ids method
Browse files Browse the repository at this point in the history
  • Loading branch information
rizwanreza authored and Wynn Netherland committed Nov 29, 2009
1 parent 488a328 commit d86ab68
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/connect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
pp twitter.friends_timeline

elsif config['rtoken'] && config['rsecret']
oauth.authorize_from_request(config['rtoken'], config['rsecret'])
oauth.authorize_from_request(config['rtoken'], config['rsecret'], 'PIN')
twitter = Twitter::Base.new(oauth)
pp twitter.friends_timeline

Expand Down
4 changes: 4 additions & 0 deletions lib/twitter/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ def help
perform_get('/help/test.json')
end

def blocked_ids
perform_get("/blocks/blocking/ids.json", :mash => false)
end

private
def perform_get(path, options={})
Twitter::Request.get(self, path, options)
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ids.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[61940910,71299457,42903387,24583357,29413354,70809474,40110661,49080026,72819428,73156755,65747904,59903590]
6 changes: 6 additions & 0 deletions test/twitter/base_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ class BaseTest < Test::Unit::TestCase
followers.should == @twitter.followers
end

should "be able to get blocked users' IDs" do
stub_get('/blocks/blocking/ids.json', 'ids.json')
blocked = @twitter.blocked_ids
blocked.should == @twitter.blocked_ids
end

end
end
end

0 comments on commit d86ab68

Please sign in to comment.