<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,4 @@
+# encoding: UTF-8
 Comment.create(
   :name         =&gt; &quot;Pat&quot;,
   :content      =&gt; &quot;+1&quot;,</diff>
      <filename>features/support/db/fixtures/comments.rb</filename>
    </modified>
    <modified>
      <diff>@@ -80,7 +80,8 @@ describe &quot;ThinkingSphinx::ActiveRecord::Delta&quot; do
         :sphinx_document_id =&gt; 1
       )
       
-      @client = Riddle::Client.stub_instance(:update =&gt; true)
+      @client = Riddle::Client.new
+      @client.stub!(:update =&gt; true)
       Riddle::Client.stub_method(:new =&gt; @client)
     end
     
@@ -120,17 +121,16 @@ describe &quot;ThinkingSphinx::ActiveRecord::Delta&quot; do
     end
     
     it &quot;shouldn't update the deleted attribute if not in the index&quot; do
-      @person.send(:index_delta)
+      @client.should_not_receive(:update)
       
-      @client.should_not have_received(:update)
+      @person.send(:index_delta)
     end
     
     it &quot;should update the deleted attribute if in the core index&quot; do
       @person.stub_method(:in_both_indexes? =&gt; true)
+      @client.should_receive(:update)
       
       @person.send(:index_delta)
-      
-      @client.should have_received(:update)
     end
   end
 end</diff>
      <filename>spec/unit/thinking_sphinx/active_record/delta_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,19 +2,19 @@ require 'spec/spec_helper'
 
 describe &quot;ThinkingSphinx::ActiveRecord::Search&quot; do
   it &quot;should add search_for_ids to ActiveRecord::Base&quot; do
-    ActiveRecord::Base.methods.should include(&quot;search_for_ids&quot;)
+    ActiveRecord::Base.should respond_to(&quot;search_for_ids&quot;)
   end
   
   it &quot;should add search_for_ids to ActiveRecord::Base&quot; do
-    ActiveRecord::Base.methods.should include(&quot;search&quot;)
+    ActiveRecord::Base.should respond_to(&quot;search&quot;)
   end
   
   it &quot;should add search_count to ActiveRecord::Base&quot; do
-    ActiveRecord::Base.methods.should include(&quot;search_count&quot;)
+    ActiveRecord::Base.should respond_to(&quot;search_count&quot;)
   end
 
   it &quot;should add search_for_id to ActiveRecord::Base&quot; do
-    ActiveRecord::Base.methods.should include(&quot;search_for_id&quot;)
+    ActiveRecord::Base.should respond_to(&quot;search_for_id&quot;)
   end
   
   describe &quot;search_for_ids method&quot; do</diff>
      <filename>spec/unit/thinking_sphinx/active_record/search_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require 'spec/spec_helper'
 describe &quot;ThinkingSphinx::ActiveRecord&quot; do
   describe &quot;define_index method&quot; do
     before :each do
-      module TestModule
+      module ::TestModule
         class TestModel &lt; ActiveRecord::Base; end
       end
       
@@ -185,7 +185,8 @@ describe &quot;ThinkingSphinx::ActiveRecord&quot; do
         :address  =&gt; &quot;an address&quot;,
         :port     =&gt; 123
       )
-      @client = Riddle::Client.stub_instance(:update =&gt; true)
+      @client = Riddle::Client.new
+      @client.stub!(:update =&gt; true)
       @person = Person.find(:first)
       
       Riddle::Client.stub_method(:new =&gt; @client)
@@ -202,87 +203,82 @@ describe &quot;ThinkingSphinx::ActiveRecord&quot; do
     end
     
     it &quot;should update the core index's deleted flag if in core index&quot; do
-      @person.toggle_deleted
-      
-      @client.should have_received(:update).with(
+      @client.should_receive(:update).with(
         &quot;person_core&quot;, [&quot;sphinx_deleted&quot;], {@person.sphinx_document_id =&gt; [1]}
       )
+      
+      @person.toggle_deleted
     end
     
     it &quot;shouldn't update the core index's deleted flag if the record isn't in it&quot; do
       @person.stub_method(:in_core_index? =&gt; false)
-      
-      @person.toggle_deleted
-      
-      @client.should_not have_received(:update).with(
+      @client.should_not_receive(:update).with(
         &quot;person_core&quot;, [&quot;sphinx_deleted&quot;], {@person.sphinx_document_id =&gt; [1]}
       )
+      
+      @person.toggle_deleted
     end
     
     it &quot;shouldn't attempt to update the deleted flag if sphinx isn't running&quot; do
       ThinkingSphinx.stub_method(:sphinx_running? =&gt; false)
+      @client.should_not_receive(:update)
       
       @person.toggle_deleted
       
       @person.should_not have_received(:in_core_index?)
-      @client.should_not have_received(:update)
     end
     
     it &quot;should update the delta index's deleted flag if delta indexes are enabled and the instance's delta is true&quot; do
       ThinkingSphinx.stub_method(:deltas_enabled? =&gt; true)
       Person.sphinx_indexes.each { |index| index.stub_method(:delta? =&gt; true) }
       @person.delta = true
-      
-      @person.toggle_deleted
-      
-      @client.should have_received(:update).with(
+      @client.should_receive(:update).with(
         &quot;person_delta&quot;, [&quot;sphinx_deleted&quot;], {@person.sphinx_document_id =&gt; [1]}
       )
+      
+      @person.toggle_deleted
     end
     
     it &quot;should not update the delta index's deleted flag if delta indexes are enabled and the instance's delta is false&quot; do
       ThinkingSphinx.stub_method(:deltas_enabled? =&gt; true)
       Person.sphinx_indexes.each { |index| index.stub_method(:delta? =&gt; true) }
       @person.delta = false
-      
-      @person.toggle_deleted
-      
-      @client.should_not have_received(:update).with(
+      @client.should_not_receive(:update).with(
         &quot;person_delta&quot;, [&quot;sphinx_deleted&quot;], {@person.sphinx_document_id =&gt; [1]}
       )
+      
+      @person.toggle_deleted
     end
     
     it &quot;should not update the delta index's deleted flag if delta indexes are enabled and the instance's delta is equivalent to false&quot; do
       ThinkingSphinx.stub_method(:deltas_enabled? =&gt; true)
       Person.sphinx_indexes.each { |index| index.stub_method(:delta? =&gt; true) }
       @person.delta = 0
-
-      @person.toggle_deleted
-
-      @client.should_not have_received(:update).with(
+      @client.should_not_receive(:update).with(
         &quot;person_delta&quot;, [&quot;sphinx_deleted&quot;], {@person.sphinx_document_id =&gt; [1]}
       )
+
+      @person.toggle_deleted
     end
 
     it &quot;shouldn't update the delta index if delta indexes are disabled&quot; do
       ThinkingSphinx.stub_method(:deltas_enabled? =&gt; true)
-      @person.toggle_deleted
-      
-      @client.should_not have_received(:update).with(
+      @client.should_not_receive(:update).with(
         &quot;person_delta&quot;, [&quot;sphinx_deleted&quot;], {@person.sphinx_document_id =&gt; [1]}
       )
+      
+      @person.toggle_deleted
     end
     
     it &quot;should not update the delta index if delta indexing is disabled&quot; do
       ThinkingSphinx.stub_method(:deltas_enabled? =&gt; false)
       Person.sphinx_indexes.each { |index| index.stub_method(:delta? =&gt; true) }
       @person.delta = true
-      
-      @person.toggle_deleted
-      
-      @client.should_not have_received(:update).with(
+      @client.should_not_receive(:update).with(
         &quot;person_delta&quot;, [&quot;sphinx_deleted&quot;], {@person.sphinx_document_id =&gt; [1]}
       )
+      
+      @person.toggle_deleted
     end
     
     it &quot;should not update either index if updates are disabled&quot; do
@@ -292,10 +288,9 @@ describe &quot;ThinkingSphinx::ActiveRecord&quot; do
       )
       Person.sphinx_indexes.each { |index| index.stub_method(:delta? =&gt; true) }
       @person.delta = true
+      @client.should_not_receive(:update)
       
       @person.toggle_deleted
-      
-      @client.should_not have_received(:update)
     end
   end
 </diff>
      <filename>spec/unit/thinking_sphinx/active_record_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -79,7 +79,8 @@ describe ThinkingSphinx::Association do
     before :each do
       @parent_join = ::ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation.stub_instance
       @join = ::ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation.stub_instance
-      @parent = ThinkingSphinx::Association.stub_instance(:join_to =&gt; true, :join =&gt; nil)
+      @parent = ThinkingSphinx::Association.new(nil, nil)
+      @parent.stub!(:join_to =&gt; true, :join =&gt; nil)
       @base_join = Object.stub_instance(:joins =&gt; [:a, :b, :c])
       
       ::ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation.stub_method(:new =&gt; @join)
@@ -87,19 +88,17 @@ describe ThinkingSphinx::Association do
     
     it &quot;should call the parent's join_to if parent has no join&quot; do
       @assoc = ThinkingSphinx::Association.new(@parent, :ref)
+      @parent.should_receive(:join_to).with(@base_join)
       
       @assoc.join_to(@base_join)
-      
-      @parent.should have_received(:join_to).with(@base_join)
     end
     
     it &quot;should not call the parent's join_to if it already has a join&quot; do
       @assoc = ThinkingSphinx::Association.new(@parent, :ref)
       @parent.stub_method(:join =&gt; @parent_join)
+      @parent.should_not_receive(:join_to)
       
       @assoc.join_to(@base_join)
-      
-      @parent.should_not have_received(:join_to)
     end
     
     it &quot;should define the join association with a JoinAssociation instance&quot; do</diff>
      <filename>spec/unit/thinking_sphinx/association_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -53,15 +53,15 @@ describe ThinkingSphinx::Attribute do
       @attribute.columns.each { |col| @attribute.associations[col] = [] }
       @attribute.model = Person
       
-      @first_join   = Object.stub_instance(:aliased_table_name =&gt; &quot;tabular&quot;)
-      @second_join  = Object.stub_instance(:aliased_table_name =&gt; &quot;data&quot;)
+      @first_join   = Object.new
+      @first_join.stub!(:aliased_table_name =&gt; &quot;tabular&quot;)
+      @second_join  = Object.new
+      @second_join.stub!(:aliased_table_name =&gt; &quot;data&quot;)
       
-      @first_assoc  = ThinkingSphinx::Association.stub_instance(
-        :join =&gt; @first_join, :has_column? =&gt; true
-      )
-      @second_assoc = ThinkingSphinx::Association.stub_instance(
-        :join =&gt; @second_join, :has_column? =&gt; true
-      )
+      @first_assoc  = ThinkingSphinx::Association.new nil, nil
+      @first_assoc.stub!(:join =&gt; @first_join, :has_column? =&gt; true)
+      @second_assoc = ThinkingSphinx::Association.new nil, nil
+      @second_assoc.stub!(:join =&gt; @second_join, :has_column? =&gt; true)
     end
     
     it &quot;should return the column name if the column is a string&quot; do</diff>
      <filename>spec/unit/thinking_sphinx/attribute_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,12 +2,13 @@ require 'spec/spec_helper'
 
 describe ThinkingSphinx::Collection do
   it &quot;should behave like WillPaginate::Collection&quot; do
-    ThinkingSphinx::Collection.instance_methods.should include(&quot;previous_page&quot;)
-    ThinkingSphinx::Collection.instance_methods.should include(&quot;next_page&quot;)
-    ThinkingSphinx::Collection.instance_methods.should include(&quot;current_page&quot;)
-    ThinkingSphinx::Collection.instance_methods.should include(&quot;total_pages&quot;)
-    ThinkingSphinx::Collection.instance_methods.should include(&quot;total_entries&quot;)
-    ThinkingSphinx::Collection.instance_methods.should include(&quot;offset&quot;)
+    instance_methods = ThinkingSphinx::Collection.instance_methods.collect { |m| m.to_s }
+    instance_methods.should include(&quot;previous_page&quot;)
+    instance_methods.should include(&quot;next_page&quot;)
+    instance_methods.should include(&quot;current_page&quot;)
+    instance_methods.should include(&quot;total_pages&quot;)
+    instance_methods.should include(&quot;total_entries&quot;)
+    instance_methods.should include(&quot;offset&quot;)
     
     ThinkingSphinx::Collection.ancestors.should include(Array)
   end</diff>
      <filename>spec/unit/thinking_sphinx/collection_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,11 +10,11 @@ describe ThinkingSphinx::Configuration do
     
     it &quot;should use the Merb environment value if set&quot; do
       unless defined?(Merb)
-        module Merb; end
+        module ::Merb; end
       end
             
       ThinkingSphinx::Configuration.stub_method(:defined? =&gt; true)
-      Merb.stub_method(:environment =&gt; &quot;merb_production&quot;)
+      Merb.stub!(:environment =&gt; &quot;merb_production&quot;)
       ThinkingSphinx::Configuration.environment.should == &quot;merb_production&quot;
       
       Object.send(:remove_const, :Merb)</diff>
      <filename>spec/unit/thinking_sphinx/configuration_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -85,15 +85,15 @@ describe ThinkingSphinx::Field do
       @field.columns.each { |col| @field.associations[col] = [] }
       @field.model = Person
       
-      @first_join   = Object.stub_instance(:aliased_table_name =&gt; &quot;tabular&quot;)
-      @second_join  = Object.stub_instance(:aliased_table_name =&gt; &quot;data&quot;)
+      @first_join   = Object.new
+      @first_join.stub!(:aliased_table_name =&gt; &quot;tabular&quot;)
+      @second_join  = Object.new
+      @second_join.stub!(:aliased_table_name =&gt; &quot;data&quot;)
       
-      @first_assoc  = ThinkingSphinx::Association.stub_instance(
-        :join =&gt; @first_join, :has_column? =&gt; true
-      )
-      @second_assoc = ThinkingSphinx::Association.stub_instance(
-        :join =&gt; @second_join, :has_column? =&gt; true
-      )
+      @first_assoc  = ThinkingSphinx::Association.new nil, nil
+      @first_assoc.stub!(:join =&gt; @first_join, :has_column? =&gt; true)
+      @second_assoc = ThinkingSphinx::Association.new nil, nil
+      @second_assoc.stub!(:join =&gt; @second_join, :has_column? =&gt; true)
     end
     
     it &quot;should return the column name if the column is a string&quot; do</diff>
      <filename>spec/unit/thinking_sphinx/field_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,12 +20,16 @@ describe ThinkingSphinx::HashExcept do
   end
   
   describe &quot;extends Hash&quot; do
+    before :each do
+      @instance_methods = Hash.instance_methods.collect { |m| m.to_s }
+    end
+    
     it 'with except' do
-      Hash.instance_methods.include?('except').should be_true
+      @instance_methods.include?('except').should be_true
     end
 
     it 'with except!' do
-      Hash.instance_methods.include?('except!').should be_true
+      @instance_methods.include?('except!').should be_true
     end
   end
 end
@@ -45,7 +49,7 @@ describe ThinkingSphinx::ArrayExtractOptions do
   
   describe &quot;extends Array&quot; do
     it 'with extract_options!' do
-      Array.instance_methods.include?('extract_options!').should be_true
+      Array.instance_methods.collect { |m| m.to_s }.include?('extract_options!').should be_true
     end
   end
 end
@@ -61,7 +65,9 @@ describe ThinkingSphinx::AbstractQuotedTableName do
   
   describe &quot;extends ActiveRecord::ConnectionAdapters::AbstractAdapter&quot; do
     it 'with quote_table_name' do
-      ActiveRecord::ConnectionAdapters::AbstractAdapter.instance_methods.include?('quote_table_name').should be_true
+      ActiveRecord::ConnectionAdapters::AbstractAdapter.instance_methods.collect { |m|
+        m.to_s
+      }.include?('quote_table_name').should be_true
     end
   end
 end
@@ -77,7 +83,9 @@ describe ThinkingSphinx::MysqlQuotedTableName do
   describe &quot;extends ActiveRecord::ConnectionAdapters::MysqlAdapter&quot; do
     it 'with quote_table_name' do
       adapter = defined?(JRUBY_VERSION) ? :JdbcAdapter : :MysqlAdapter
-      ActiveRecord::ConnectionAdapters.const_get(adapter).instance_methods.include?(&quot;quote_table_name&quot;).should be_true
+      ActiveRecord::ConnectionAdapters.const_get(adapter).instance_methods.collect { |m|
+        m.to_s
+      }.include?(&quot;quote_table_name&quot;).should be_true
     end
   end  
 end</diff>
      <filename>spec/unit/thinking_sphinx/rails_additions_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,8 @@ describe ThinkingSphinx::Search do
   describe &quot;search method&quot; do
     describe &quot;:star option&quot; do
       before :each do
-        @client = Riddle::Client.stub_instance(
+        @client = Riddle::Client.new
+        @client.stub!(
           :filters    =&gt; [],
           :filters=   =&gt; true,
           :id_range=  =&gt; true,
@@ -26,25 +27,29 @@ describe ThinkingSphinx::Search do
       end
       
       it &quot;should not apply by default&quot; do
+        @client.should_receive(:query).with(&quot;foo bar&quot;,'*','')
+        
         ThinkingSphinx::Search.search &quot;foo bar&quot;
-        @client.should have_received(:query).with(&quot;foo bar&quot;,'*','')
       end
 
       it &quot;should apply when passed, and handle full extended syntax&quot; do
         input    = %{a b* c (d | e) 123 5&amp;6 (f_f g) !h &quot;i j&quot; &quot;k l&quot;~10 &quot;m n&quot;/3 @o p -(q|r)}
         expected = %{*a* b* *c* (*d* | *e*) *123* *5*&amp;*6* (*f_f* *g*) !*h* &quot;i j&quot; &quot;k l&quot;~10 &quot;m n&quot;/3 @o *p* -(*q*|*r*)}
+        @client.should_receive(:query).with(expected,'*','')
+        
         ThinkingSphinx::Search.search input, :star =&gt; true
-        @client.should have_received(:query).with(expected,'*','')
       end
 
       it &quot;should default to /\w+/ as token&quot; do
+        @client.should_receive(:query).with(&quot;*foo*@*bar*.*com*&quot;,'*','')
+        
         ThinkingSphinx::Search.search &quot;foo@bar.com&quot;, :star =&gt; true
-        @client.should have_received(:query).with(&quot;*foo*@*bar*.*com*&quot;,'*','')
       end
 
       it &quot;should honour custom token&quot; do
+        @client.should_receive(:query).with(&quot;*foo@bar.com* -*foo-bar*&quot;,'*','')
+        
         ThinkingSphinx::Search.search &quot;foo@bar.com -foo-bar&quot;, :star =&gt; /[\w@.-]+/u
-        @client.should have_received(:query).with(&quot;*foo@bar.com* -*foo-bar*&quot;,'*','')
       end
     end
     </diff>
      <filename>spec/unit/thinking_sphinx/search_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -105,12 +105,14 @@ describe ThinkingSphinx do
     
     describe &quot;if not using MySQL&quot; do
       before :each do
-        adapter = defined?(JRUBY_VERSION) ? :JdbcAdapter : :PostgreSQLAdapter
+        adapter = defined?(JRUBY_VERSION) ? 'JdbcAdapter' : 'PostgreSQLAdapter'
         unless ::ActiveRecord::ConnectionAdapters.const_defined?(adapter)
           pending &quot;No PostgreSQL&quot;
           return
         end
-        @connection = ::ActiveRecord::ConnectionAdapters.const_get(adapter).stub_instance(
+        
+        @connection = stub(adapter).as_null_object
+        @connection.stub!(
           :select_all =&gt; true,
           :config =&gt; {:adapter =&gt; defined?(JRUBY_VERSION) ? 'jdbcpostgresql' : 'postgresql'}
         )
@@ -124,9 +126,9 @@ describe ThinkingSphinx do
       end
     
       it &quot;should not call select_all&quot; do
-        ThinkingSphinx.use_group_by_shortcut?
+        @connection.should_not_receive(:select_all)
         
-        @connection.should_not have_received(:select_all)
+        ThinkingSphinx.use_group_by_shortcut?
       end
     end
   end</diff>
      <filename>spec/unit/thinking_sphinx_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>907cb35153db7dc3ba2f49220226f692ab284a61</id>
    </parent>
  </parents>
  <author>
    <name>Pat Allan</name>
    <email>pat@freelancing-gods.com</email>
  </author>
  <url>http://github.com/freelancing-god/thinking-sphinx/commit/d9d090e4bfb2f86c0d1bf43cfe7b87b57073d04e</url>
  <id>d9d090e4bfb2f86c0d1bf43cfe7b87b57073d04e</id>
  <committed-date>2009-06-07T15:03:54-07:00</committed-date>
  <authored-date>2009-06-07T14:34:12-07:00</authored-date>
  <message>Making test suite run happily on Ruby 1.9.1</message>
  <tree>3ef708a4b05ab6d182a2fb16f9b49048e8dd06df</tree>
  <committer>
    <name>Pat Allan</name>
    <email>pat@freelancing-gods.com</email>
  </committer>
</commit>
