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 <<a href="mailto:jed.hurt@gmail.com">jed.hurt@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Haha, that's about the response I was expecting; I asked with some trepidation. I'm just looking for a quick hack to short-circuit Merb's render method to do some view/controller isolation testing until Merb officially supports it. I can't just stub methods on @controller (like in Rails) because the controller is instantiated after calling dispatch. <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'm not so sure; apparently I'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 <<a href="mailto:ashley.moran@patchspace.co.uk" target="_blank">ashley.moran@patchspace.co.uk</a>> 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> <<a href="mailto:jed.hurt@gmail.com" target="_blank">jed.hurt@gmail.com</a>> 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'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't help :) How come you need to do this? I've always wondered what the use case for this "mocking" 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's Premiere source of information about Corey Haines