Could you stub out Controller.new and return your mock?<br><br><div class="gmail_quote">On Tue, Apr 1, 2008 at 1:19 PM, Jed Hurt &lt;<a href="mailto:jed.hurt@gmail.com">jed.hurt@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Haha, that&#39;s about the response I was expecting; I asked with some trepidation. I&#39;m just looking for a quick hack to short-circuit Merb&#39;s render method to do some view/controller isolation testing until Merb officially supports it. I can&#39;t just stub methods on @controller (like in Rails) because the controller is instantiated after calling dispatch.&nbsp;<div>

<br></div><div>I suppose I could whip up a different sort of hack to accomplish the isolation in the meantime, but now I&#39;m not so sure; apparently I&#39;m quite a noob ;)<br><br><div class="gmail_quote"><div><div></div>
<div class="Wj3C7c">On Tue, Apr 1, 2008 at 1:50 AM, Ashley Moran &lt;<a href="mailto:ashley.moran@patchspace.co.uk" target="_blank">ashley.moran@patchspace.co.uk</a>&gt; wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="Wj3C7c"><div>On 01/04/2008, <b class="gmail_sendername">Jed Hurt</b> &lt;<a href="mailto:jed.hurt@gmail.com" target="_blank">jed.hurt@gmail.com</a>&gt; wrote:</div>

<div><div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
Is there an easy way to stub an instance method for every new instance of a given class? I suppose I could just redefine the method, but I&#39;m wondering if the RSpec mocking framework has this built in.
</blockquote></div><div><br>Hi Jed<br><br>I hate it when other people ask this, but I can&#39;t help :)&nbsp; How come you need to do this?&nbsp; I&#39;ve always wondered what the use case for this &quot;mocking&quot; strategy is<br>

<br>
Ashley<br></div></div>
<br></div></div><div class="Ih2E3d">_______________________________________________<br>
rspec-users mailing list<br>
<a href="mailto:rspec-users@rubyforge.org" target="_blank">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br></div></blockquote></div><br></div>
<br>_______________________________________________<br>
rspec-users mailing list<br>
<a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.coreyhaines.com">http://www.coreyhaines.com</a><br>
The Internet&#39;s Premiere source of information about Corey Haines