<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/json/beer_minus_root.json</filename>
    </added>
    <added>
      <filename>test/json/flight_negative_tude.json</filename>
    </added>
    <added>
      <filename>test/json/from_alexiskold.json</filename>
    </added>
    <added>
      <filename>test/json/ftw_until.json</filename>
    </added>
    <added>
      <filename>test/json/happy_hour_exact.json</filename>
    </added>
    <added>
      <filename>test/json/hashtag_haiku.json</filename>
    </added>
    <added>
      <filename>test/json/hilarious_links.json</filename>
    </added>
    <added>
      <filename>test/json/movie_positive_tude.json</filename>
    </added>
    <added>
      <filename>test/json/obama_or_hillary.json</filename>
    </added>
    <added>
      <filename>test/json/only_one_result.json</filename>
    </added>
    <added>
      <filename>test/json/page_one.json</filename>
    </added>
    <added>
      <filename>test/json/page_two.json</filename>
    </added>
    <added>
      <filename>test/json/reference_mashable.json</filename>
    </added>
    <added>
      <filename>test/json/results_per_page.json</filename>
    </added>
    <added>
      <filename>test/json/superhero_since.json</filename>
    </added>
    <added>
      <filename>test/json/to_techcrunch.json</filename>
    </added>
    <added>
      <filename>test/json/traffic_question.json</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,7 @@
 require File.join(File.dirname(__FILE__), 'test_helper')
 
 class ForeignLanguagesTest &lt; Test::Unit::TestCase # :nodoc:
-  context &quot;client.query(:q =&gt; 'congratulations', :lang =&gt; 'en')&quot; do
+  context &quot;english&quot; do
     setup do
       query   = { :q =&gt; 'congratulations', :lang =&gt; 'en' }
       fake_query(query, 'english.json')</diff>
      <filename>test/foreign_languages_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,91 +1,120 @@
 require File.join(File.dirname(__FILE__), 'test_helper')
 
 class OperatorsTest &lt; Test::Unit::TestCase # :nodoc:
-  context '@client.query :q =&gt; \'&quot;happy hour&quot;\'' do
+  context &quot;quoted phrase&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'happy_hour_exact'
+      query   = { :q =&gt; '&quot;happy hour&quot;' }
+      fake_query(query, 'happy_hour_exact.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
 
     should 'find tweets containing the exact phrase &quot;happy hour&quot;' do
-      assert @tweets.all?{ |t| t.text =~ /happy hour/i }
+      @tweets.each do |tweet|
+        assert_match /happy hour/i, tweet.text
+      end
     end
   end
 
-  context &quot;@client.query :q =&gt; 'obama OR hillary'&quot; do
+  context &quot;OR&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'obama_or_hillary'
+      query   = { :q =&gt; 'obama OR hillary' }
+      fake_query(query, 'obama_or_hillary.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
 
     should 'find tweets containing either &quot;obama&quot; or &quot;hillary&quot; (or both)' do
-      assert @tweets.all?{ |t| t.text =~ /obama/i || t.text =~ /hillary/i }
+      @tweets.each do |tweet|
+        assert_match /obama|hillary/i, tweet.text
+      end
     end
   end
 
-  context &quot;@client.query :q =&gt; 'beer -root'&quot; do
+  context &quot;minus&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'beer_minus_root'
+      query   = { :q =&gt; 'beer -root' }
+      fake_query(query, 'beer_minus_root.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
 
     should 'find tweets containing &quot;beer&quot; but not &quot;root&quot;' do
-      assert @tweets.all?{ |t| t.text =~ /beer/i || t.text !~ /root/i }
+      assert @tweets.all? { |tweet|
+        tweet.text =~ /beer/i ||
+        tweet.text !~ /root/i
+      }
     end
   end
 
-  context &quot;@client.query :q =&gt; '#haiku'&quot; do
+  context &quot;hashtag&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'hashtag_haiku'
+      query   = { :q =&gt; '#haiku' }
+      fake_query(query, 'hashtag_haiku.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
 
     should 'find tweets containing the hashtag &quot;haiku&quot;' do
-      assert @tweets.all?{ |t| t.text =~ /#haiku/i }
+      @tweets.each do |tweet|
+        assert_match /#haiku/i, tweet.text
+      end
     end
   end
 
-  context &quot;@client.query :q =&gt; 'from: alexiskold'&quot; do
+  context &quot;from&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'from_alexiskold'
+      query   = { :q =&gt; 'from:alexiskold' }
+      fake_query(query, 'from_alexiskold.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
 
     should 'find tweets sent from person &quot;alexiskold&quot;' do
-      assert @tweets.all?{ |t| t.from_user == 'alexiskold' }
+      @tweets.each do |tweet|
+        assert_equal 'alexiskold', tweet.from_user
+      end
     end
   end
 
-  context &quot;@client.query :q =&gt; 'to:techcrunch'&quot; do
+  context &quot;to&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'to_techcrunch'
+      query   = { :q =&gt; 'to:techcrunch' }
+      fake_query(query, 'to_techcrunch.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
 
     should 'find tweets sent to person &quot;techcrunch&quot;' do
-      assert @tweets.all?{ |t| t.text =~ /^@techcrunch/i }
+      @tweets.each do |tweet|
+        assert_match /^@techcrunch/i, tweet.text
+      end
     end
   end
 
   context &quot;@client.query :q =&gt; '@mashable'&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'reference_mashable'
+      query   = { :q =&gt; '@mashable' }
+      fake_query(query, 'reference_mashable.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
 
     should 'find tweets referencing person &quot;mashable&quot;' do
-      assert @tweets.all?{ |t| t.text =~ /@mashable/i }
+      @tweets.each do |tweet|
+        assert_match /@mashable/i, tweet.text
+      end
     end
   end
 
-  context &quot;@client.query :q =&gt; '\&quot;happy hour\&quot; near:\&quot;san francisco\&quot;'&quot; do
+  context &quot;near&quot; do
     should 'raise SearchOperatorError' do
       assert_raise TwitterSearch::SearchOperatorError do
         client = TwitterSearch::Client.new
@@ -94,7 +123,7 @@ class OperatorsTest &lt; Test::Unit::TestCase # :nodoc:
     end
   end
 
-  context &quot;@client.query :q =&gt; 'near:NYC within:15mi'&quot; do
+  context &quot;within&quot; do
     should 'raise SearchOperatorError' do
       assert_raise TwitterSearch::SearchOperatorError do
         client = TwitterSearch::Client.new
@@ -103,9 +132,11 @@ class OperatorsTest &lt; Test::Unit::TestCase # :nodoc:
     end
   end
 
-  context &quot;@client.query :q =&gt; 'superhero since:2008-05-01'&quot; do
+  context &quot;since&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'superhero_since'
+      query   = { :q =&gt; 'superhero since:2009-06-29' }
+      fake_query(query, 'superhero_since.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
@@ -116,16 +147,19 @@ class OperatorsTest &lt; Test::Unit::TestCase # :nodoc:
       end
     end
 
-    should 'find tweets sent since date &quot;2008-05-01&quot; (year-month-day)' do
+    should 'find tweets sent since date &quot;2009-06-29&quot; (year-month-day)' do
       @tweets.each do |tweet|
-        assert convert_date(tweet.created_at) &gt; DateTime.new(2008, 5, 1)
+        date = convert_date(tweet.created_at)
+        assert date &gt; DateTime.new(2009, 6, 29)
       end
     end
   end
 
-  context &quot;@client.query :q =&gt; 'ftw until:2008-05-03'&quot; do
+  context &quot;until&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'ftw_until'
+      query   = { :q =&gt; 'ftw until:2009-06-30' }
+      fake_query(query, 'ftw_until.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
@@ -136,58 +170,79 @@ class OperatorsTest &lt; Test::Unit::TestCase # :nodoc:
       end
     end
 
-    should &quot;find tweets sent up to date 2008-05-03&quot; do
+    should &quot;find tweets sent up to date 2009-06-30&quot; do
       @tweets.each do |tweet|
-        assert convert_date(tweet.created_at) &lt; DateTime.new(2008, 5, 3, 11, 59)
+        assert convert_date(tweet.created_at) &lt; DateTime.new(2009, 6, 30, 11, 59)
       end
     end
   end
 
-  context &quot;@client.query :q =&gt; 'movie -scary :)'&quot; do
+  context &quot;positive attitude&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'movie_positive_tude'
+      query   = { :q =&gt; 'movie -scary :)' }
+      fake_query(query, 'movie_positive_tude.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
 
     should 'find tweets containing &quot;movie&quot;, but not &quot;scary&quot;, and with a positive attitude' do
-      assert @tweets.all?{ |t| t.text =~ /movie/i &amp;&amp; t.text !~ /scary/i &amp;&amp; positive_attitude?(t.text) }
+      assert @tweets.all? { |tweet|
+        tweet.text =~ /movie/i &amp;&amp;
+        tweet.text !~ /scary/i &amp;&amp;
+        positive_attitude?(tweet.text)
+      }
     end
   end
 
-  context &quot;@client.query :q =&gt; 'flight :('&quot; do
+  context &quot;negative attitude&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'flight_negative_tude'
+      query   = { :q =&gt; 'flight :(' }
+      fake_query(query, 'flight_negative_tude.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
 
     should 'find tweets containing &quot;flight&quot; and with a negative attitude' do
-      assert @tweets.all?{ |t| t.text =~ /flight/i &amp;&amp; negative_attitude?(t.text) }
+      assert @tweets.all? { |tweet|
+        tweet.text =~ /flight/i &amp;&amp;
+        negative_attitude?(tweet.text)
+      }
     end
   end
 
-  context &quot;@client.query :q =&gt; 'traffic ?'&quot; do
+  context &quot;question&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'traffic_question'
+      query   = { :q =&gt; 'traffic ?' }
+      fake_query(query, 'traffic_question.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
 
     should 'find tweets containing &quot;traffic&quot; and asking a question' do
-      assert @tweets.all?{ |t| t.text =~ /traffic/i &amp;&amp; t.text.include?('?') }
+      assert @tweets.all? { |tweet|
+        tweet.text =~ /traffic/i &amp;&amp;
+        tweet.text.include?('?')
+      }
     end
   end
 
-  context &quot;@client.query :q =&gt; 'hilarious filter:links'&quot; do
+  context &quot;filter&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'hilarious_links'
+      query   = { :q =&gt; 'hilarious filter:links' }
+      fake_query(query, 'hilarious_links.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_have_default_search_behaviors
 
     should 'find tweets containing &quot;hilarious&quot; and linking to URLs' do
-      assert @tweets.all?{ |t| t.text =~ /hilarious/i &amp;&amp; hyperlinks?(t.text) }
+      assert @tweets.all? { |tweet|
+        tweet.text =~ /hilarious/i &amp;&amp;
+        hyperlinks?(tweet.text)
+      }
     end
   end
 end</diff>
      <filename>test/operators_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,11 @@
 require File.join(File.dirname(__FILE__), 'test_helper')
 
 class PaginationTest &lt; Test::Unit::TestCase # :nodoc:
-  context &quot;@client.query :q =&gt; 'Boston Celtics', :rpp =&gt; '30'&quot; do
+  context &quot;results per page&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'results_per_page'
+      query   = { :q =&gt; 'Boston Celtics', :rpp =&gt; '30' }
+      fake_query(query, 'results_per_page.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should_find_tweets
@@ -14,7 +16,9 @@ class PaginationTest &lt; Test::Unit::TestCase # :nodoc:
 
   context &quot;@client.query :q =&gt; 'a Google(or Twitter)whack', :rpp =&gt; '2'&quot; do
     setup do
-      @tweets = read_yaml :file =&gt; 'only_one_result'
+      query   = { :q =&gt; 'beginning class is in-depth ruby', :rpp =&gt; '2' }
+      fake_query(query, 'only_one_result.json')
+      @tweets = TwitterSearch::Client.new.query(query)
     end
 
     should 'not be able to get next page of @tweets' do
@@ -22,19 +26,25 @@ class PaginationTest &lt; Test::Unit::TestCase # :nodoc:
     end
   end
 
-  context &quot;@client.query :q =&gt; 'almost Google(or Twitter)whack', :rpp =&gt; '1'&quot; do
+  context &quot;get next page&quot; do
     setup do
-      @page_one = read_yaml :file =&gt; 'only_two_results'
-      @page_two = read_yaml :file =&gt; 'only_two_results_page_2'
+      query     = { :q =&gt; 'thoughtbot', :rpp =&gt; '1' }
+      fake_query(query, 'page_one.json')
+      @page_one = TwitterSearch::Client.new.query(query)
+
+      query     = { :q =&gt; 'thoughtbot', :rpp =&gt; '1', :page =&gt; '2' }
+      fake_query(query, 'page_two.json')
+      @page_two = TwitterSearch::Client.new.query(query)
     end
 
     should 'be able to get next page of @tweets' do
       assert @page_one.has_next_page?
 
-      FakeWeb.register_uri( :get,
-                            &quot;#{TwitterSearch::Client::TWITTER_SEARCH_API_URL}?max_id=100&amp;q=almost+a+Google%28or+is+it+Twitter%29whack&amp;rpp=1&amp;page=2&quot;,
-                            :body =&gt; '{&quot;results&quot;:[{&quot;text&quot;:&quot;Boston Celtics-Los Angeles Lakers, Halftime http://tinyurl.com/673s24&quot;,&quot;from_user&quot;:&quot;nbatube&quot;,&quot;id&quot;:858836387,&quot;language&quot;:&quot;en&quot;,&quot;created_at&quot;:&quot;Tue, 15 Jul 2008 09:27:57 +0000&quot;}],&quot;since_id&quot;:0,&quot;max_id&quot;:100,&quot;results_per_page&quot;:1,&quot;page&quot;:2,&quot;query&quot;:&quot;almost+a+Google%28or+is+it+Twitter%29whack&quot;}'
-                          )
+      query_string = &quot;max_id=2407099995&amp;q=thoughtbot&amp;rpp=1&amp;page=2&quot;
+      uri = &quot;#{TwitterSearch::Client::TWITTER_SEARCH_API_URL}?#{query_string}&quot;
+      FakeWeb.register_uri(:get, uri,
+        :response =&gt; File.here / 'json' / &quot;page_two.json&quot;)
+
       next_page = @page_one.get_next_page
       assert_equal @page_two[0].created_at, next_page[0].created_at
       assert_equal @page_two[0].text,       next_page[0].text</diff>
      <filename>test/pagination_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 require File.join(File.dirname(__FILE__), 'test_helper')
 
 class SearchTest &lt; Test::Unit::TestCase # :nodoc:
-  context &quot;client.query('Obama')&quot; do
+  context &quot;single word&quot; do
     setup do
       fake_query('Obama', 'obama.json')
       @tweets = TwitterSearch::Client.new.query('Obama')
@@ -14,7 +14,7 @@ class SearchTest &lt; Test::Unit::TestCase # :nodoc:
     end
   end
 
-  context &quot;client.query('twitter search')&quot; do
+  context &quot;two words&quot; do
     setup do
       fake_query('twitter search', 'twitter_search.json')
       @tweets = TwitterSearch::Client.new.query('twitter search')
@@ -27,7 +27,7 @@ class SearchTest &lt; Test::Unit::TestCase # :nodoc:
     end
   end
 
-  context &quot;client.query(:q =&gt; 'twitter search')&quot; do
+  context &quot;two words with :q option&quot; do
     setup do
       fake_query({ :q =&gt; 'twitter search' }, 'twitter_search.json')
       @tweets = TwitterSearch::Client.new.query(:q =&gt; 'twitter search')
@@ -40,7 +40,7 @@ class SearchTest &lt; Test::Unit::TestCase # :nodoc:
     end
   end
 
-  context &quot;a complicated search that results in a 404&quot; do
+  context &quot;response is a 404&quot; do
     setup do
       uri = &quot;http://search.twitter.com/search.json?q=rails+-from%3Adhh+from%3Alof&amp;since_id=1791298088&quot;
       FakeWeb.register_uri(:get, uri,
@@ -56,7 +56,7 @@ class SearchTest &lt; Test::Unit::TestCase # :nodoc:
     end
   end
 
-  context &quot;a search that returns a 200 but an unparsable body&quot; do
+  context &quot;response is 200 but an unparsable body&quot; do
     setup do
       uri = &quot;http://search.twitter.com/search.json?rpp=100&amp;q=ftc&amp;since_id=2147483647&amp;page=16&quot;
       FakeWeb.register_uri(:get, uri,</diff>
      <filename>test/search_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,11 +25,6 @@ require 'fakeweb'
 FakeWeb.allow_net_connect = false
 
 class Test::Unit::TestCase
-  def read_yaml(opts = {})
-    raise ArgumentError if opts[:file].nil?
-    YAML.load_file(File.here / 'yaml' / &quot;#{opts[:file]}.yaml&quot;)
-  end
-
   def parse_json(opts = {})
     raise ArgumentError if opts[:file].nil?
     json = IO.read(File.here / 'json' / &quot;#{opts[:file]}.json&quot;)
@@ -38,7 +33,7 @@ class Test::Unit::TestCase
 
   def fake_query(query, file_name)
     sanitized_query = TwitterSearch::Client.new.sanitize_query(query)
-    uri = &quot;http://search.twitter.com/search.json?#{sanitized_query}&quot;
+    uri = &quot;#{TwitterSearch::Client::TWITTER_SEARCH_API_URL}?#{sanitized_query}&quot;
     FakeWeb.register_uri(:get, uri, :response =&gt; File.here / 'json' / file_name)
   end
 
@@ -55,11 +50,13 @@ class Test::Unit::TestCase
   end
 
   def positive_attitude?(string)
-    [&quot;:)&quot;, &quot;=)&quot;, &quot;:-)&quot;, &quot;:D&quot;].any? { |emoticon| string.include?(emoticon) }
+    emoticons = [&quot;:)&quot;, &quot;=)&quot;, &quot;:-)&quot;, &quot;:D&quot;, &quot;: )&quot;]
+    emoticons.any? { |emoticon| string.include?(emoticon) }
   end
 
   def negative_attitude?(string)
-    [&quot;:(&quot;, &quot;=(&quot;, &quot;:-(&quot;, &quot;:P&quot;].any? { |emoticon| string.include?(emoticon) }
+    emoticons = [&quot;:(&quot;, &quot;=(&quot;, &quot;:-(&quot;, &quot;:P&quot;, &quot;: (&quot;]
+    emoticons.any? { |emoticon| string.include?(emoticon) }
   end
 
   def hyperlinks?(string)</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 require File.join(File.dirname(__FILE__), 'test_helper')
 
 class TrendsTest &lt; Test::Unit::TestCase # :nodoc:
-  context &quot;@client.trends&quot; do
+  context &quot;trends&quot; do
     setup do
       @trends = parse_json :file =&gt; 'trends'
     end</diff>
      <filename>test/trends_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c40984242213bd80b1de79873d8028758ae2ea1b</id>
    </parent>
  </parents>
  <author>
    <name>Daniel Croak</name>
    <email>dancroak@dan-lawlesss-macbook.local</email>
  </author>
  <url>http://github.com/dancroak/twitter-search/commit/33a935f0606931c18541d2460ee08a31cc6d6d9f</url>
  <id>33a935f0606931c18541d2460ee08a31cc6d6d9f</id>
  <committed-date>2009-06-30T11:21:18-07:00</committed-date>
  <authored-date>2009-06-30T11:20:57-07:00</authored-date>
  <message>all tests now running off json &amp; Fakeweb instead of yaml files</message>
  <tree>4d51fb545abd00e357f9344b072fa473594da663</tree>
  <committer>
    <name>Daniel Croak</name>
    <email>dancroak@dan-lawlesss-macbook.local</email>
  </committer>
</commit>
