<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Unstubbing methods in Mocha</title>
	<atom:link href="http://szeryf.wordpress.com/2007/11/09/unstubbing-methods-in-mocha/feed/" rel="self" type="application/rss+xml" />
	<link>http://szeryf.wordpress.com/2007/11/09/unstubbing-methods-in-mocha/</link>
	<description>The blog with the bug.</description>
	<lastBuildDate>Thu, 23 May 2013 14:32:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: floehopper</title>
		<link>http://szeryf.wordpress.com/2007/11/09/unstubbing-methods-in-mocha/#comment-1270</link>
		<dc:creator><![CDATA[floehopper]]></dc:creator>
		<pubDate>Wed, 07 Mar 2012 14:44:55 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/2007/11/09/unstubbing-methods-in-mocha/#comment-1270</guid>
		<description><![CDATA[A bit late, but this functionality was added [1] to Mocha some time ago. Cheers, James.

[1] http://mocha.rubyforge.org/Mocha/Mock.html#method-i-unstub]]></description>
		<content:encoded><![CDATA[<p>A bit late, but this functionality was added [1] to Mocha some time ago. Cheers, James.</p>
<p>[1] <a href="http://mocha.rubyforge.org/Mocha/Mock.html#method-i-unstub" rel="nofollow">http://mocha.rubyforge.org/Mocha/Mock.html#method-i-unstub</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob</title>
		<link>http://szeryf.wordpress.com/2007/11/09/unstubbing-methods-in-mocha/#comment-1049</link>
		<dc:creator><![CDATA[Jacob]]></dc:creator>
		<pubDate>Fri, 21 Aug 2009 15:57:02 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/2007/11/09/unstubbing-methods-in-mocha/#comment-1049</guid>
		<description><![CDATA[I too was struggling with a way to unstub in mocha.

I found:

Mocha::Mockery.instance.stubba.unstub_all

and

Mocha::Mockery.instance.stubba.stubba_methods

on which you can do:

      Mocha::Mockery.instance.stubba.stubba_methods.each do &#124;meth&#124;
        if meth.stubbee == SomeClassOrInstanceIWantToUnstub &amp;&amp; meth.method == &quot;somemethodtounstub&quot;
          meth.unstub
        end
      end]]></description>
		<content:encoded><![CDATA[<p>I too was struggling with a way to unstub in mocha.</p>
<p>I found:</p>
<p>Mocha::Mockery.instance.stubba.unstub_all</p>
<p>and</p>
<p>Mocha::Mockery.instance.stubba.stubba_methods</p>
<p>on which you can do:</p>
<p>      Mocha::Mockery.instance.stubba.stubba_methods.each do |meth|<br />
        if meth.stubbee == SomeClassOrInstanceIWantToUnstub &amp;&amp; meth.method == &#8220;somemethodtounstub&#8221;<br />
          meth.unstub<br />
        end<br />
      end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: szeryf</title>
		<link>http://szeryf.wordpress.com/2007/11/09/unstubbing-methods-in-mocha/#comment-447</link>
		<dc:creator><![CDATA[szeryf]]></dc:creator>
		<pubDate>Sun, 10 Feb 2008 09:28:32 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/2007/11/09/unstubbing-methods-in-mocha/#comment-447</guid>
		<description><![CDATA[David, that&#039;s a good point, but sometimes you just have one test that won&#039;t work with setup and a new file would be an overkill. And splitting test methods throughout many files makes it harder to find them. 

But I think it should be possible to create many test classes in the same test file and that would also solve the problem. (Autotest would probably frown upon it, though.)

And yes, you&#039;re right, RSpec&#039;s and shoulda&#039;s context blocks also solve it.

The example wasn&#039;t meant to be realistic, only to illustrate what to do when you need to unstub something.]]></description>
		<content:encoded><![CDATA[<p>David, that&#8217;s a good point, but sometimes you just have one test that won&#8217;t work with setup and a new file would be an overkill. And splitting test methods throughout many files makes it harder to find them. </p>
<p>But I think it should be possible to create many test classes in the same test file and that would also solve the problem. (Autotest would probably frown upon it, though.)</p>
<p>And yes, you&#8217;re right, RSpec&#8217;s and shoulda&#8217;s context blocks also solve it.</p>
<p>The example wasn&#8217;t meant to be realistic, only to illustrate what to do when you need to unstub something.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Lowenfels</title>
		<link>http://szeryf.wordpress.com/2007/11/09/unstubbing-methods-in-mocha/#comment-446</link>
		<dc:creator><![CDATA[David Lowenfels]]></dc:creator>
		<pubDate>Sun, 10 Feb 2008 06:03:29 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/2007/11/09/unstubbing-methods-in-mocha/#comment-446</guid>
		<description><![CDATA[If the setup methods don&#039;t apply to your test, then perhaps you need to create a new test file?

One of the cool things about the shoulda testing framework, is that you can have multiple context blocks each with their own setups, and can nest them. I think RSpec probably does the same thing. I imagine that you are using RSpec these days, from your more recent posts.]]></description>
		<content:encoded><![CDATA[<p>If the setup methods don&#8217;t apply to your test, then perhaps you need to create a new test file?</p>
<p>One of the cool things about the shoulda testing framework, is that you can have multiple context blocks each with their own setups, and can nest them. I think RSpec probably does the same thing. I imagine that you are using RSpec these days, from your more recent posts.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
