<?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: Testing trivialities &#8230; and double-entry bookkeeping</title>
	<atom:link href="http://www.kerrybuckley.org/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kerrybuckley.org/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/</link>
	<description>What's the simplest thing that could possibly go wrong?</description>
	<lastBuildDate>Mon, 30 Jan 2012 16:30:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Kerry</title>
		<link>http://www.kerrybuckley.org/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/comment-page-1/#comment-418</link>
		<dc:creator>Kerry</dc:creator>
		<pubDate>Fri, 09 Mar 2007 09:05:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrybuckley.com/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/#comment-418</guid>
		<description>One day I&#039;ll get round to &lt;a href=&quot;/2007/01/17/i-guess-i-really-ought-to-learn-lisp/&quot; rel=&quot;nofollow&quot;&gt;learning Lisp&lt;/a&gt;, then perhaps I&#039;ll find out whether it&#039;s true or not.</description>
		<content:encoded><![CDATA[<p>One day I&#8217;ll get round to <a href="/2007/01/17/i-guess-i-really-ought-to-learn-lisp/" rel="nofollow">learning Lisp</a>, then perhaps I&#8217;ll find out whether it&#8217;s true or not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary Casey</title>
		<link>http://www.kerrybuckley.org/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/comment-page-1/#comment-417</link>
		<dc:creator>Gary Casey</dc:creator>
		<pubDate>Fri, 09 Mar 2007 00:31:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrybuckley.com/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/#comment-417</guid>
		<description>&quot;you don&#039;t have to test&quot;. Wow.</description>
		<content:encoded><![CDATA[<p>&#8220;you don&#8217;t have to test&#8221;. Wow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: http://www.tapsellferrier.co.uk/nicferrier</title>
		<link>http://www.kerrybuckley.org/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/comment-page-1/#comment-350</link>
		<dc:creator>http://www.tapsellferrier.co.uk/nicferrier</dc:creator>
		<pubDate>Sat, 03 Mar 2007 17:29:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrybuckley.com/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/#comment-350</guid>
		<description>If you adopt functional programming, you don&#039;t have to test. Well, you test your assumptions maybe.</description>
		<content:encoded><![CDATA[<p>If you adopt functional programming, you don&#8217;t have to test. Well, you test your assumptions maybe.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kerry</title>
		<link>http://www.kerrybuckley.org/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/comment-page-1/#comment-321</link>
		<dc:creator>Kerry</dc:creator>
		<pubDate>Thu, 01 Mar 2007 23:05:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrybuckley.com/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/#comment-321</guid>
		<description>Thanks Dan, that makes a lot of sense.

The point about not changing the state in the specify block is interesting &#8211; I think this is where a three-level given-when-then approach (&#224; la &lt;a href=&quot;http://dannorth.net/&quot; rel=&quot;nofollow&quot;&gt;Dan North&lt;/a&gt;) might be better than rspec&#039;s context-specify model.</description>
		<content:encoded><![CDATA[<p>Thanks Dan, that makes a lot of sense.</p>
<p>The point about not changing the state in the specify block is interesting &ndash; I think this is where a three-level given-when-then approach (&agrave; la <a href="http://dannorth.net/" rel="nofollow">Dan North</a>) might be better than rspec&#8217;s context-specify model.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Kubb</title>
		<link>http://www.kerrybuckley.org/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/comment-page-1/#comment-318</link>
		<dc:creator>Dan Kubb</dc:creator>
		<pubDate>Thu, 01 Mar 2007 20:06:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrybuckley.com/2007/03/01/testing-trivialities-and-double-entry-bookkeeping/#comment-318</guid>
		<description>After testing a few different approaches, I&#039;ve settled on using One Expectation per Example. 

What I do is use the setup block to set up the state of whatever I&#039;m testing, and my specify blocks to confirm the state is as expected.  I aim not to change the state in any way in the specify blocks, and also try to keep my specify blocks to a single line of code.

So in the example above I&#039;d assign to @user.attributes inside the setup block, and then I&#039;d have two specify blocks: one to check to make sure its not valid, and one to test the error message.

Actually I&#039;d probably have one more specify block just to make sure the number of error messages is equal to 1, which alerts me if other errors creep in unexpectedly.

It probably goes without saying that before all this I&#039;d probably have another context block that assigns all the valid_user_attributes and specifies that @user.should_be_valid. 

Yeah its a bit more verbose than what you&#039;re showing above, but it really is much easier to pinpoint where the problem is when stuff goes wrong.  If you&#039;re using Textmate and folding, you can just minimize finished contexts and specifications, so it really doesn&#039;t take up that much visual space on the screen.</description>
		<content:encoded><![CDATA[<p>After testing a few different approaches, I&#8217;ve settled on using One Expectation per Example. </p>
<p>What I do is use the setup block to set up the state of whatever I&#8217;m testing, and my specify blocks to confirm the state is as expected.  I aim not to change the state in any way in the specify blocks, and also try to keep my specify blocks to a single line of code.</p>
<p>So in the example above I&#8217;d assign to @user.attributes inside the setup block, and then I&#8217;d have two specify blocks: one to check to make sure its not valid, and one to test the error message.</p>
<p>Actually I&#8217;d probably have one more specify block just to make sure the number of error messages is equal to 1, which alerts me if other errors creep in unexpectedly.</p>
<p>It probably goes without saying that before all this I&#8217;d probably have another context block that assigns all the valid_user_attributes and specifies that @user.should_be_valid. </p>
<p>Yeah its a bit more verbose than what you&#8217;re showing above, but it really is much easier to pinpoint where the problem is when stuff goes wrong.  If you&#8217;re using Textmate and folding, you can just minimize finished contexts and specifications, so it really doesn&#8217;t take up that much visual space on the screen.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.248 seconds -->

