Sha256: 2b5a363c7c20e315c9db0cf59b549caf01343d0db7750ef0ba948b7c78bba12f
Contents?: true
Size: 1.48 KB
Versions: 2
Compression:
Stored size: 1.48 KB
Contents
require File.dirname(__FILE__) + '/../lib/twitter-search-watcher' require 'rubygems' require 'spec' require 'ostruct' def readable value OpenStruct.new({ :read => value }) end def fake_response_for watcher end def fake_response options = {} readable( { 'max_id' => 1234, 'since_id' => 0, 'total' => 15, # doesn't appear if next_page present? 'next_page' => '?page=2&max_id=1234&q=remitaylor', # only appears if there are additional pages 'refresh_url' => '?since_id=1234&q=remitaylor', 'page' => 1, 'results_per_page' => 15, 'completed_in' => 0.1234, 'query' => 'remitaylor', 'results' => fake_tweets }.merge(options).to_json ) end def fake_tweets [ fake_tweet, fake_tweet ] end def fake_tweet { "created_at"=>"Wed, 05 Aug 2009 03:54:03 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/346217637/tiltshiftdino_normal.jpg", "from_user"=>"BaddMann", "to_user_id"=>549282, "text"=>"@remitaylor What did you think of the badges at defcon Did you try anything with your badge", "id" => (rand * 1000000000).to_i, "from_user_id"=>160309, "to_user"=>"remitaylor", "iso_language_code"=>"en", "source"=>"<a href="http://twitter.com/">web</a>"} end Spec::Matchers.define :end_with do |expected| match do |actual| actual.end_with? expected end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
devfu-twitter-search-watcher-0.1.0 | spec/spec_helper.rb |
devfu-twitter-search-watcher-0.1.1 | spec/spec_helper.rb |