<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,7 +4,7 @@ RSpec-Rails Mocha plugin
 This brings functionality of `mock_model` and `stub_model` from rspec-rails to those using Mocha.
 
     require 'rubygems'
-    gem 'rspec', '1.1.4'
+    gem 'rspec', '1.1.12'
     require 'spec'
     require 'spec/rails'
     require 'rspec_rails_mocha'</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
 
 module Spec
   module Rails
-    
+
     unless defined?(IllegalDataAccessException)
       class IllegalDataAccessException &lt; StandardError; end
     end
@@ -12,16 +12,16 @@ module Spec
       # Creates a mock object instance for a +model_class+ with common
       # methods stubbed out. Additional methods may be easily stubbed (via
       # add_stubs) if +stubs+ is passed.
-      def mock_model(model_class, params = {})
-        id = params[:id] || next_id
-        model = stub(&quot;#{model_class.name}_#{id}&quot;, {
+      def mock_model(model_class, options_and_stubs = {})
+        id = options_and_stubs[:id] || next_id
+        options_and_stubs = options_and_stubs.reverse_merge({
           :id =&gt; id,
           :to_param =&gt; id.to_s,
           :new_record? =&gt; false,
           :errors =&gt; stub(&quot;errors&quot;, :count =&gt; 0)
-        }.update(params))
-        
-        model.instance_eval &lt;&lt;-CODE
+        })
+        m = stub(&quot;#{model_class.name}_#{id}&quot;, options_and_stubs)
+        m.instance_eval &lt;&lt;-CODE
           def as_new_record
             self.stubs(:id).returns(nil)
             self.stubs(:to_param).returns(nil)
@@ -41,9 +41,8 @@ module Spec
             #{model_class}
           end
         CODE
-        
-        yield model if block_given?
-        return model
+        yield m if block_given?
+        m
       end
       
       module ModelStubber
@@ -63,6 +62,7 @@ module Spec
       #   stub_model(Model)
       #   stub_model(Model).as_new_record
       #   stub_model(Model, hash_of_stubs)
+      #   stub_model(Model, instance_variable_name, hash_of_stubs)
       #
       # Creates an instance of +Model+ that is prohibited from accessing the
       # database*. For each key in +hash_of_stubs+, if the model has a
@@ -98,27 +98,34 @@ module Spec
       #   stub_model(Person) do |person|
       #     person.first_name = &quot;David&quot;
       #   end
-      def stub_model(model_class, params = {})
-        params = params.dup
-        model = model_class.new
-        model.id = params.delete(:id) || next_id
-        
-        model.extend ModelStubber
-        params.keys.each do |prop|
-          model[prop] = params.delete(prop) if model.has_attribute?(prop)
+      def stub_model(model_class, stubs={})
+        stubs = {:id =&gt; next_id}.merge(stubs)
+        returning(model_class.new) do |model|
+          model.id = stubs.delete(:id)
+          model.extend ModelStubber
+          stubs.each do |k,v|
+            if model.has_attribute?(k)
+              model[k] = stubs.delete(k)
+            end
+          end
+          model.stubs(stubs)
+          yield model if block_given?
         end
-        add_stubs(model, params)
-        
-        yield model if block_given?
-        return model
       end
       
+      # DEPRECATED - use object.stubs(:method =&gt; value, :method2 =&gt; value)
+      #
       # Stubs methods on +object+ (if +object+ is a symbol or string a new mock
       # with that name will be created). +stubs+ is a Hash of +method=&gt;value+
-      def add_stubs(object, params) # :nodoc:
-        m = [String, Symbol].include?(object.class) ? mock(object.to_s) : object
-        params.each { |prop, value| m.stubs(prop).returns(value) }
-        m
+      def add_stubs(object, stubs = {}) #:nodoc:
+        Kernel.warn &lt;&lt;-WARNING
+DEPRECATION NOTICE: add_stubs is deprecated and will be removed
+from a future version of rspec-rails. Use this instead:
+  
+  object.stubs(:method =&gt; value, :method2 =&gt; value)
+  
+WARNING
+        object.stubs(stubs)
       end
 
       private</diff>
      <filename>lib/rspec_rails_mocha.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,13 @@
 require 'rubygems'
-gem 'rspec', '1.1.4'
+gem 'rspec', '1.1.12'
 require 'spec'
 require File.dirname(__FILE__) + '/../lib/rspec_rails_mocha'
 
+require 'active_support/core_ext/hash/reverse_merge'
+include ActiveSupport::CoreExtensions::Hash::ReverseMerge
+
+require 'active_support/core_ext/object/misc'
+
 class Person
   attr_accessor :id, :name
   </diff>
      <filename>spec/mocha_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0a832b1965fedfcfc15873e0c20ba937302a43ee</id>
    </parent>
  </parents>
  <author>
    <name>Steven Luscher</name>
    <email>github@stevenluscherdesign.com</email>
  </author>
  <url>http://github.com/mislav/rspec-rails-mocha/commit/14d725ff67c41e972f860855ef4bada85a797925</url>
  <id>14d725ff67c41e972f860855ef4bada85a797925</id>
  <committed-date>2009-02-05T16:35:40-08:00</committed-date>
  <authored-date>2009-02-04T16:18:47-08:00</authored-date>
  <message>Brought the plugin up to date with rspec 1.1.12.</message>
  <tree>7ba769962ff855ae979282f34e8621a382ab4ccb</tree>
  <committer>
    <name>Mislav Marohni&#263;</name>
    <email>mislav.marohnic@gmail.com</email>
  </committer>
</commit>
