<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,5 @@
+* Allow mock model class to be set using :as option.
+
 * [DEPRECATION] By default all matchers perform expectations, use with_stubs =&gt; true
   if you want otherwise.
 </diff>
      <filename>remarkable_rails/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -405,6 +405,12 @@ module Remarkable
         #
         # == Options
         #
+        # * &lt;tt&gt;:as&lt;/tt&gt; -  Used to set the model . For example, if you have
+        #   Admin::Task model, you have to tell the name of the class to be
+        #   mocked:
+        #
+        #      mock_models :admin_task, :as =&gt; &quot;Admin::Task&quot;
+        #
         # * &lt;tt&gt;:class_method&lt;/tt&gt; - When set to false, does not create the
         #   class method which returns a proc.
         #
@@ -440,6 +446,8 @@ module Remarkable
 
           models.each do |model|
             model = model.to_s
+            klass = options[:as] || model.classify
+
             if options[:class_method]
               (class &lt;&lt; self; self; end).class_eval &lt;&lt;-METHOD
                 def #{model}_proc; proc { mock_#{model} }; end
@@ -452,11 +460,12 @@ module Remarkable
 
             self.class_eval &lt;&lt;-METHOD
               def mock_#{model}(stubs={})
-                @#{model} ||= mock_model(#{model.classify}, stubs)
+                @#{model} ||= mock_model(#{klass}, stubs)
               end
             METHOD
           end
         end
+        alias :mock_model :mock_models
 
       end
 </diff>
      <filename>remarkable_rails/lib/remarkable_rails/action_controller/macro_stubs.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,13 +24,13 @@ describe 'MacroStubs' do
       self.class.respond_to?(:mock_projects).should be_true
     end
 
-    it 'should create a class singular mock method' do
+    it 'should create a class singular proc method' do
       self.class.respond_to?(:project_proc).should be_false
       self.class.mock_models :project
       self.class.respond_to?(:project_proc).should be_true
     end
 
-    it 'should create a class plural mock method' do
+    it 'should create a class plural proc method' do
       self.class.respond_to?(:projects_proc).should be_false
       self.class.mock_models :project
       self.class.respond_to?(:projects_proc).should be_true
@@ -50,7 +50,14 @@ describe 'MacroStubs' do
       self.respond_to?(:mock_project).should be_true
     end
 
-    it 'should create procs which evals to a mock dynamically' do
+    it 'should allow the mock class to be set' do
+      self.class.mock_model :project, :as =&gt; &quot;::Admin::Project&quot;
+      lambda{
+        mock_project
+      }.should raise_error(NameError, &quot;uninitialized constant Admin&quot;)
+    end
+
+    it 'should create procs which evals to a mock' do
       proc = self.class.task_proc
       proc.should be_kind_of(Proc)
 
@@ -59,7 +66,7 @@ describe 'MacroStubs' do
       @task.should_not be_nil
     end
 
-    it 'should create procs which evals to an array of mocks dynamically' do
+    it 'should create procs which evals to an array of mocks' do
       proc = self.class.tasks_proc
       proc.should be_kind_of(Proc)
 </diff>
      <filename>remarkable_rails/spec/action_controller/macro_stubs_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f824ea527f787a5b65aabd19b2ccfa1e0ff5ecbf</id>
    </parent>
  </parents>
  <author>
    <name>Jos&#233; Valim</name>
    <email>jose.valim@gmail.com</email>
  </author>
  <url>http://github.com/lawrencepit/remarkable/commit/0a55a73606df779f9fd6fc60b66b8c808983ee4e</url>
  <id>0a55a73606df779f9fd6fc60b66b8c808983ee4e</id>
  <committed-date>2009-06-06T02:03:47-07:00</committed-date>
  <authored-date>2009-06-06T02:03:47-07:00</authored-date>
  <message>Allow mock class to be given using the :as option.</message>
  <tree>f63773c37b3e488a1cda6e393a9994f8b0ad7691</tree>
  <committer>
    <name>Jos&#233; Valim</name>
    <email>jose.valim@gmail.com</email>
  </committer>
</commit>
