This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.document | Thu Aug 20 22:30:37 -0700 2009 | |
| |
.gitignore | Thu Aug 20 22:30:37 -0700 2009 | |
| |
LICENSE | Thu Aug 20 22:30:37 -0700 2009 | |
| |
README.textile | Tue Nov 03 17:53:05 -0800 2009 | |
| |
Rakefile | Fri Aug 21 02:36:00 -0700 2009 | |
| |
VERSION | Tue Nov 03 17:53:36 -0800 2009 | |
| |
faketwitter.gemspec | Tue Nov 03 17:55:21 -0800 2009 | |
| |
lib/ | Mon Aug 24 09:17:03 -0700 2009 | |
| |
spec/ | Mon Aug 24 09:17:03 -0700 2009 |
README.textile
faketwitter
Factory goodness for twitter search responses wrapped in FakeWeb awesomeness.
irb(main):001:0> require 'faketwitter'
=> true
irb(main):002:0> require 'twitter_search'
=> true
irb(main):003:0> FakeTwitter.register_search("#cheese", {:results => [{:text => "#cheese is good"}]})
=> [#<FakeWeb::Responder:0x19792c0 @times=1, @uri="http://search.twitter.com/search.json?q=%23cheese", @options={:body=>"{"results":[{"text":"#cheese is good","from_user":"jojo","to_user_id":null,"id":1,"from_user_id":1,"iso_language_code":"en","source":"<a href="http:\\/\\/twitter.com\\/">web<\\/a>","created_at":"Fri, 21 Aug 2009 09:31:27 +0000","profile_image_url":"http:\\/\\/s3.amazonaws.com\\/twitter_production\\/profile_images\\/1\\/photo.jpg"}],"since_id":0,"max_id":1,"results_per_page":15,"completed_in":0.008646,"page":1,"query":"%23cheese"}"}, method:get]
irb(main):004:0> TwitterSearch::Client.new('').query('#cheese')
=> [#<TwitterSearch::Tweet:0x196cef8 @id=1, @text="#cheese is good", @created_at="Fri, 21 Aug 2009 09:31:27 +0000", @to_user_id=nil, @from_user_id=1, @to_user=nil, @source="<a href="http://twitter.com/">web</a>", @iso_language_code="en", @from_user="jojo", @language="en", @profile_image_url="http://s3.amazonaws.com/twitter_production/profile_images/1/photo.jpg">]
irb(main):005:0>
For an example on how to use this in Cucumber see this scenario and the corresponding step definitions.
Documentation is lacking at this point, but there really isn’t much to this gem. Take a look at the code and the corresponding RSpec examples.







