<?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/"
		>
<channel>
	<title>Comments on: I just wrote another mock object framework.</title>
	<atom:link href="http://blog.tplus1.com/index.php/2008/09/26/i-just-wrote-another-mock-object-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tplus1.com/index.php/2008/09/26/i-just-wrote-another-mock-object-framework/</link>
	<description>Programming, gardening, economics, life in Cleveland Heights</description>
	<lastBuildDate>Sat, 04 Feb 2012 03:03:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matt Wilson</title>
		<link>http://blog.tplus1.com/index.php/2008/09/26/i-just-wrote-another-mock-object-framework/comment-page-1/#comment-3381</link>
		<dc:creator>Matt Wilson</dc:creator>
		<pubDate>Mon, 29 Sep 2008 20:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=221#comment-3381</guid>
		<description>Consider that name stolen :)</description>
		<content:encoded><![CDATA[<p>Consider that name stolen <img src='http://blog.tplus1.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Wyglendowski</title>
		<link>http://blog.tplus1.com/index.php/2008/09/26/i-just-wrote-another-mock-object-framework/comment-page-1/#comment-3380</link>
		<dc:creator>Christian Wyglendowski</dc:creator>
		<pubDate>Mon, 29 Sep 2008 19:34:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=221#comment-3380</guid>
		<description>This is about the only mock object framework that I would use.  The only thing it needs is a better name.  OckMock - &quot;The simplest answer is usually the correct answer.&quot;</description>
		<content:encoded><![CDATA[<p>This is about the only mock object framework that I would use.  The only thing it needs is a better name.  OckMock &#8211; &#8220;The simplest answer is usually the correct answer.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Wilson</title>
		<link>http://blog.tplus1.com/index.php/2008/09/26/i-just-wrote-another-mock-object-framework/comment-page-1/#comment-1370</link>
		<dc:creator>Matt Wilson</dc:creator>
		<pubDate>Mon, 29 Sep 2008 16:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=221#comment-1370</guid>
		<description>Consider that name stolen :)</description>
		<content:encoded><![CDATA[<p>Consider that name stolen <img src='http://blog.tplus1.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Wyglendowski</title>
		<link>http://blog.tplus1.com/index.php/2008/09/26/i-just-wrote-another-mock-object-framework/comment-page-1/#comment-1369</link>
		<dc:creator>Christian Wyglendowski</dc:creator>
		<pubDate>Mon, 29 Sep 2008 15:34:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=221#comment-1369</guid>
		<description>This is about the only mock object framework that I would use.  The only thing it needs is a better name.  OckMock - &quot;The simplest answer is usually the correct answer.&quot;</description>
		<content:encoded><![CDATA[<p>This is about the only mock object framework that I would use.  The only thing it needs is a better name.  OckMock &#8211; &#8220;The simplest answer is usually the correct answer.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Wilson</title>
		<link>http://blog.tplus1.com/index.php/2008/09/26/i-just-wrote-another-mock-object-framework/comment-page-1/#comment-1372</link>
		<dc:creator>Matt Wilson</dc:creator>
		<pubDate>Sat, 27 Sep 2008 13:53:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=221#comment-1372</guid>
		<description>Hi Ben,&lt;br&gt;&lt;br&gt;I probably should have included a few example uses.  Pretend I want to mock an object that has an attribute named ivr_sends which is a list of strings.  I&#039;d do this:&lt;br&gt;&lt;br&gt;mm = BazMock(ivr_sends=[&#039;abc&#039;, &#039;def&#039;])&lt;br&gt;&lt;br&gt;Now my test code can access mm.ivr_sends just fine.&lt;br&gt;&lt;br&gt;And now pretend you need to mock attributes on attributes:&lt;br&gt;&lt;br&gt;mm = BazMock(x=BazMock(y=[BazMock(a=1, b=2), BazMock(a=3, b=4)]))&lt;br&gt;&lt;br&gt;And now I can access mm.x.y[0].a.&lt;br&gt;&lt;br&gt;For methods, you&#039;d need to graft on definitions like this:&lt;br&gt;&lt;br&gt;def fake_foo(x):&lt;br&gt;    return &quot;99&quot;&lt;br&gt;&lt;br&gt;mm.foo = fake_foo&lt;br&gt;&lt;br&gt;I&#039;ve been told that there are better mock objects out there, that do stuff like inspect a module or a class and create mocks automatically.&lt;br&gt;&lt;br&gt;I&#039;m dragging my feet about learning them.  Let me know if you find one you like.</description>
		<content:encoded><![CDATA[<p>Hi Ben,</p>
<p>I probably should have included a few example uses.  Pretend I want to mock an object that has an attribute named ivr_sends which is a list of strings.  I&#39;d do this:</p>
<p>mm = BazMock(ivr_sends=[&#39;abc&#39;, &#39;def&#39;])</p>
<p>Now my test code can access mm.ivr_sends just fine.</p>
<p>And now pretend you need to mock attributes on attributes:</p>
<p>mm = BazMock(x=BazMock(y=[BazMock(a=1, b=2), BazMock(a=3, b=4)]))</p>
<p>And now I can access mm.x.y[0].a.</p>
<p>For methods, you&#39;d need to graft on definitions like this:</p>
<p>def fake_foo(x):<br />    return &#8220;99&#8243;</p>
<p>mm.foo = fake_foo</p>
<p>I&#39;ve been told that there are better mock objects out there, that do stuff like inspect a module or a class and create mocks automatically.</p>
<p>I&#39;m dragging my feet about learning them.  Let me know if you find one you like.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Finney</title>
		<link>http://blog.tplus1.com/index.php/2008/09/26/i-just-wrote-another-mock-object-framework/comment-page-1/#comment-1371</link>
		<dc:creator>Ben Finney</dc:creator>
		<pubDate>Sat, 27 Sep 2008 06:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=221#comment-1371</guid>
		<description>Doesn&#039;t seem too useful; when the code under test attempts to call expected methods on an instance it&#039;ll fail with &#039;AttributeError&#039;. A mock object should pretend it&#039;s the object being mocked, surely?</description>
		<content:encoded><![CDATA[<p>Doesn&#39;t seem too useful; when the code under test attempts to call expected methods on an instance it&#39;ll fail with &#39;AttributeError&#39;. A mock object should pretend it&#39;s the object being mocked, surely?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Barton</title>
		<link>http://blog.tplus1.com/index.php/2008/09/26/i-just-wrote-another-mock-object-framework/comment-page-1/#comment-1373</link>
		<dc:creator>Michael Barton</dc:creator>
		<pubDate>Fri, 26 Sep 2008 22:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=221#comment-1373</guid>
		<description>Hey, you stole that code from my ORM.</description>
		<content:encoded><![CDATA[<p>Hey, you stole that code from my ORM.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

