<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>brew manager development blog &#187; unit test</title>
	<atom:link href="http://blog.brewmanager.com/tag/unit-test/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.brewmanager.com</link>
	<description>Follwing the development of brewmanager.com</description>
	<lastBuildDate>Sat, 07 Feb 2009 13:44:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Looking at unit tests</title>
		<link>http://blog.brewmanager.com/2008/06/23/looking-at-unit-tests/</link>
		<comments>http://blog.brewmanager.com/2008/06/23/looking-at-unit-tests/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 02:16:49 +0000</pubDate>
		<dc:creator>krujos</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[unit test]]></category>

		<guid isPermaLink="false">http://blog.brewmanager.com/?p=16</guid>
		<description><![CDATA[I neglected to read the ruby / rails unit test documentation because it seemed cumbersome at first glance. I rolled my own thing for models and assumed controllers would do what they were supposed to do. That worked well enough to get me up and going but tonight I decided I needed something more reliable [...]]]></description>
			<content:encoded><![CDATA[<p>I neglected to read the ruby / rails unit test documentation because it seemed cumbersome at first glance. I rolled my own thing for models and assumed controllers would do what they were supposed to do. That worked well enough to get me up and going but tonight I decided I needed something more reliable and rather than reinvent the wheel&#8230;..</p>
<p>So I did some <a title="unit testing. " href="http://manuals.rubyonrails.com/read/chapter/20">reading</a>. The unit tests aren&#8217;t as decoupled as I would like them to be (yes <a title="Michael Feathers" href="http://www.michaelfeathers.com/">Michael Feathers, you have made an impact in my life</a> (his <a title="Working Effectivly with Legacy Code" href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1214273567&amp;sr=8-1">legacy code book</a> is pretty good. I suggest it). I firmly believe that a unit test should not use a database or network. I think you can do that with the model well enough (by avoiding fixtures), but it looks next to impossible for controllers. From what I&#8217;ve read testing a controller makes http requests to the web server. I&#8217;m not a purist or anything, but its a bummer it has to do that. And I don&#8217;t think I can setup an in memory model object for a controller to work with (I&#8217;m probably wrong about that, I&#8217;d guess there&#8217;s some magic) I&#8217;d imagine for a full tests suite it would slow things down considerably. The other thing I&#8217;m not immediately seeing is a way to sense through a fixture. While not strictly necessary (and may in fact be more trouble than its worth) it sounds like a neat idea. All that said, it looks like the functional testing you can do with the unit test framework is pretty slick. I&#8217;m kicking around the idea of setting up some sort of nightly check out / test run just for kicks.</p>
<p>There has been a vanilla crisis in my house ( I think I get cookies!) I&#8217;m out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brewmanager.com/2008/06/23/looking-at-unit-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
