<?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>gregs &#187; tdd</title>
	<atom:link href="http://gregs.tcias.co.uk/category/comps/tdd/feed/" rel="self" type="application/rss+xml" />
	<link>http://gregs.tcias.co.uk</link>
	<description>helping me remember what I figure out</description>
	<lastBuildDate>Fri, 03 Feb 2012 01:04:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Small update to my jasmine BDD post</title>
		<link>http://gregs.tcias.co.uk/2011/09/25/small-update-to-my-jasmine-bdd-post/</link>
		<comments>http://gregs.tcias.co.uk/2011/09/25/small-update-to-my-jasmine-bdd-post/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 19:55:31 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[jasmine]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=720</guid>
		<description><![CDATA[Following on from my post way back in July, I have created a repository over at the github, with some updated examples surrounding validation, adding comments to posts and some refactoring. I am currently looking into DI for javascript objects, &#8230; <a href="http://gregs.tcias.co.uk/2011/09/25/small-update-to-my-jasmine-bdd-post/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Following on from my post way back in July, I have created a <a href="https://github.com/gregstewart/node-blog" title="Node-blog github repository">repository</a> over at the github, with some updated examples surrounding validation, adding comments to posts and some refactoring. </p>
<p>I am currently looking into DI for javascript objects, as well as <a href="http://www.phantomjs.org/" title="PhantomJS: Headless WebKit with JavaScript API">phantom.js</a> and <a href="https://github.com/velesin/jasmine-jquery" title="Jasmine-jquery github repository">jasmine-jquery</a> to start putting together some examples for user journey testing and easier testing of jquery widgets and fixture loading.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2011/09/25/small-update-to-my-jasmine-bdd-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First steps with Jasmine</title>
		<link>http://gregs.tcias.co.uk/2011/07/12/first-steps-with-jasmine/</link>
		<comments>http://gregs.tcias.co.uk/2011/07/12/first-steps-with-jasmine/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 16:27:08 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[jasmine]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=712</guid>
		<description><![CDATA[New job and opportunities. One of the core approaches to developing here, is the use TDD. Now in a JS/UI kind of role this is really novel approach (well at least for me). I don't know how many times in &#8230; <a href="http://gregs.tcias.co.uk/2011/07/12/first-steps-with-jasmine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>New job and opportunities. One of the core approaches to developing here, is the use TDD. Now in a JS/UI kind of role this is really novel approach (well at least for me). I don't know how many times in the past I have lamented the fact that I needed to click through way too many steps to get to the issue at hand and then rinse and repeat to debug/fix. Even once I had wrapped my head round Chrome's debugger this approach still took way too long. I had dabbled a little in TDD and BDD on personal ruby projects, but never from a UI perspective and when faced with a monumental UI code base I just didn't have the stomach to tackle the problem retro fit tests. Also to be honest the JavaScript testing frameworks just didn't click with me, until Node.js and Jasmine that is.</p>
<p>With Node.js installed grab the following modules using npm</p>
<ul>
<li>coffee-script</li>
<li>jasmine-node</li>
</ul>
<p>Easiest way to get tests running type 'node ./spec.js ' at the command line, which is pointing to ./spec/ folder</p>
<p>In my BlogSpec.js file let's start with some basic tests</p>
<div class="igBar"><span id="lcode-9"><a href="#" onclick="javascript:showPlainTxt('code-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-9">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">describe<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'blog creation'</span>, function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; it<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'should have a title attribute'</span>, function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; expect<span style="color:#006600; font-weight:bold;">&#40;</span>testBlog.<span style="">title</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">toBeDefined</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; it<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'should have a title'</span>, function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; expect<span style="color:#006600; font-weight:bold;">&#40;</span>testBlog.<span style="">title</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">not</span>.<span style="">toBeNull</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>When you run the spec with : 'node-blog git:(master) ✗ node spec.js' the test should fail</p>
<div class="igBar"><span id="lcode-10"><a href="#" onclick="javascript:showPlainTxt('code-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-10">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Started</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">FF</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Spec blog creation</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; it should have a title attribute</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; Error: ReferenceError: testBlog is not defined</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; at new &amp;lt;anonymous&amp;gt; <span style="color:#006600; font-weight:bold;">&#40;</span>/Users/gregstewart/Projects/node-blog/node_modules/jasmine-node/lib/jasmine-node/jasmine-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="">js</span>:<span style="color:#800000;color:#800000;">94</span>:<span style="color:#800000;color:#800000;">50</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; at <span style="color:#006600; font-weight:bold;">&#91;</span>object Object<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="">fail</span> <span style="color:#006600; font-weight:bold;">&#40;</span>/Users/gregstewart/Projects/node-blog/node_modules/jasmine-node/lib/jasmine-node/jasmine-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="">js</span>:<span style="color:#800000;color:#800000;">1963</span>:<span style="color:#800000;color:#800000;">27</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; at <span style="color:#006600; font-weight:bold;">&#91;</span>object Object<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="">execute</span> <span style="color:#006600; font-weight:bold;">&#40;</span>/Users/gregstewart/Projects/node-blog/node_modules/jasmine-node/lib/jasmine-node/jasmine-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="">js</span>:<span style="color:#800000;color:#800000;">970</span>:<span style="color:#800000;color:#800000;">15</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; at <span style="color:#006600; font-weight:bold;">&#91;</span>object Object<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="">next_</span> <span style="color:#006600; font-weight:bold;">&#40;</span>/Users/gregstewart/Projects/node-blog/node_modules/jasmine-node/lib/jasmine-node/jasmine-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="">js</span>:<span style="color:#800000;color:#800000;">1739</span>:<span style="color:#800000;color:#800000;">31</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; at <span style="color:#006600; font-weight:bold;">&#91;</span>object Object<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="">start</span> <span style="color:#006600; font-weight:bold;">&#40;</span>/Users/gregstewart/Projects/node-blog/node_modules/jasmine-node/lib/jasmine-node/jasmine-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="">js</span>:<span style="color:#800000;color:#800000;">1692</span>:<span style="color:#800000;color:#800000;">8</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; at <span style="color:#006600; font-weight:bold;">&#91;</span>object Object<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="">execute</span> <span style="color:#006600; font-weight:bold;">&#40;</span>/Users/gregstewart/Projects/node-blog/node_modules/jasmine-node/lib/jasmine-node/jasmine-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span>.<span style="">js</span>:<span style="color:#800000;color:#800000;">2018</span>:<span style="color:#800000;color:#800000;">14</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; at <span style="color:#006600; font-weight:bold;">&#91;</span>object Object<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="">next_</span> <span style="color:#006600; font-weight:bold;">&#40;</span>/Users/gregstewart/Projects/node-blog/node_modules/jasmine-node/lib/jasmine-node/jasmin% </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>So everything is as expected at this stage, let's start work on getting the basic tests to pass. First off let's create out Blog object</p>
<div class="igBar"><span id="lcode-11"><a href="#" onclick="javascript:showPlainTxt('code-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-11">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Blog = function<span style="color:#006600; font-weight:bold;">&#40;</span>title<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; this.<span style="">title</span> = title;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Blog.<span style="">prototype</span>.<span style="">getTitle</span> = function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; return this.<span style="">title</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">exports.<span style="">Blog</span> = Blog; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And not let's bring the Blog object into our test and initialise it:</p>
<div class="igBar"><span id="lcode-12"><a href="#" onclick="javascript:showPlainTxt('code-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-12">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">var Blog = require<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'../Blog'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">Blog</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">describe<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'blog creation'</span>, function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; var testBlog;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; beforeEach<span style="color:#006600; font-weight:bold;">&#40;</span>function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; testBlog = new Blog<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; it<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'should have a title attribute'</span>, function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; expect<span style="color:#006600; font-weight:bold;">&#40;</span>testBlog.<span style="">title</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">toBeDefined</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; it<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'should have a title'</span>, function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; expect<span style="color:#006600; font-weight:bold;">&#40;</span>testBlog.<span style="">title</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">not</span>.<span style="">toBeNull</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now let's get the first test to pass, by editing our Blog.js file</p>
<div class="igBar"><span id="lcode-13"><a href="#" onclick="javascript:showPlainTxt('code-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-13">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Blog = function<span style="color:#006600; font-weight:bold;">&#40;</span>title<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; this.<span style="">title</span> = typeof title !== <span style="color:#CC0000;">'undefined'</span> ? title : null;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Blog.<span style="">prototype</span>.<span style="">getTitle</span> = function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; return this.<span style="">title</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">exports.<span style="">Blog</span> = Blog; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nearly there, only problem is that our second test is failing because we require a title to not be null.</p>
<div class="igBar"><span id="lcode-14"><a href="#" onclick="javascript:showPlainTxt('code-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-14">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">var Blog = require<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'../Blog'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">Blog</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">describe<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'blog creation'</span>, function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; var testBlog;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; beforeEach<span style="color:#006600; font-weight:bold;">&#40;</span>function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; testBlog = new Blog<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'test'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; it<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'should have a title attribute'</span>, function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; expect<span style="color:#006600; font-weight:bold;">&#40;</span>testBlog.<span style="">title</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">toBeDefined</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; it<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'should have a title value'</span>, function<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; expect<span style="color:#006600; font-weight:bold;">&#40;</span>testBlog.<span style="">title</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">not</span>.<span style="">toBeNull</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Let's see what the output looks like:</p>
<div class="igBar"><span id="lcode-15"><a href="#" onclick="javascript:showPlainTxt('code-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-15">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">➜  node-blog git:<span style="color:#006600; font-weight:bold;">&#40;</span>master<span style="color:#006600; font-weight:bold;">&#41;</span> ✗ node spec.<span style="">js</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Started</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">..</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">Spec</span> blog creation</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Finished in <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">001</span> seconds</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">1</span> test, <span style="color:#800000;color:#800000;">2</span> assertions, <span style="color:#800000;color:#800000;">0</span> failures </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And just because I can, let's rewrite the Blog.js in Coffee Script:</p>
<div class="igBar"><span id="lcode-16"><a href="#" onclick="javascript:showPlainTxt('code-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-16">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">class Blog</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; constructor:<span style="color:#006600; font-weight:bold;">&#40;</span>@title<span style="color:#006600; font-weight:bold;">&#41;</span> -&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="">getTitle</span>: -&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; @title</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">exports.<span style="">Blog</span> = Blog; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>How much terser is that?</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2011/07/12/first-steps-with-jasmine/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby, Rails, Git and Heroku</title>
		<link>http://gregs.tcias.co.uk/2011/02/17/ruby-rails-git-and-heroku/</link>
		<comments>http://gregs.tcias.co.uk/2011/02/17/ruby-rails-git-and-heroku/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 17:26:00 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[autotest]]></category>
		<category><![CDATA[rspec]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=614</guid>
		<description><![CDATA[Over Christmas and last month, I decided to resurrect www.tcias.co.uk. Initially it was just a static html site, but I decided to re-build it using Ruby and Rails. While it's very much like using a sledgehammer to tap in a &#8230; <a href="http://gregs.tcias.co.uk/2011/02/17/ruby-rails-git-and-heroku/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Over Christmas and last month, I decided to resurrect <a href="http://www.tcias.co.uk/">www.tcias.co.uk</a>. Initially it was just a static html site, but I decided to re-build it using Ruby and Rails. While it's very much like using a sledgehammer to tap in a small protruding nail, I figured it was a simple enough project to explore building a Rails app. I had a few goals in mind:</p>
<ul>
<li>Use <a href="http://git-scm.com/">Git</a></li>
<li>Build it using tests (<a href="http://rspec.info/">Rspec</a>)</li>
<li>and conversely take a look at BBD</li>
<li>Refactor common elements using partials</li>
<li>Have fun</li>
</ul>
<p><a href="http://heroku.com/">Heroku</a> came along after the initial build because my server seemed to struggle serving the app using a combination of Apache and Passenger Phusion (looks like I need more RAM...). Overall the experience has simply put been great. Building an app using the Ruby and Rails toolset is just a pleasure. <a href="http://rvm.beginrescueend.com/">RVM</a> for ruby version management, Bundler for Gem management, <a href="https://github.com/grosser/autotest">autotest</a> for <a href="http://ph7spot.com/musings/getting-started-with-autotest">continuous background tests</a>, easy deployment with <a href="http://git-scm.com/">Git</a> integration. Compared to the CF world I am in [big caveat this might not be true for you], the rails ecosystm is incredibly rich, well documented, functional and fun.</p>
<p>I started off by following the Rails guide over at <a href="http://ruby.railstutorial.org/chapters/">Rails Tutorial</a> and borrowed the set up to get started. After creating my project, the first thing I got to grips with was getting <a href="http://git-scm.com/">Git</a> set up. I use both a local repository and a remote one over at <a href="https://github.com/gregstewart/Teacup-In-A-Storm">Github</a>, Knowing that your code is versioned in two places is quite a comfort and I have since started using it for absolutely everything locally and have pushed a few other projects (terribly old projects that I am a little embarrassed about, but being the sentimental individual didn't want to loose) on to <a href="https://github.com/">Github</a>. </p>
<p>Then came setting up <a href="https://github.com/grosser/autotest">autotest</a>, having this run in the background with Growl integration gives you instant notification that your tests are passing or failing whenever you save a file. This is so incredibly useful and responsive. I really love the continuous testing nature of this setup.</p>
<p>Given the nature of the site, the coding part was easy-ish and I am sure there are a plenty of things I have done like a noob.</p>
<p>Where all this really comes to shine is during deployment time. I opted for <a href="http://heroku.com/">Heroku</a>, it wasn't so much a choice as a case of I'd be stupid not to. The documentation for signing up and getting started is first class (as it is with <a href="https://github.com/">Github</a> by the way). Once you have your account, created your app and linked it to your git repository, deploying your code is a simple case of typing:</p>
<div class="igBar"><span id="lcode-19"><a href="#" onclick="javascript:showPlainTxt('code-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-19">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">git push heroku master </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>From then on in, you just watch the code being checked out, gem dependency being resolved and your app launching. Knowing that your site is Ok thanks to your tests, the one line deployment command is pure joy.</p>
<p>To give you an indication of how great this setup is, consider that I decided to switch from <a href="http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/">erb</a> files to <a href="http://haml-lang.com/">Haml</a>. I spent a few hours reading up and converting my erb files over, while having autotest running showing me where things were breaking (due to my lack of knowledge of the new syntax) or working. Then pushing changes into Git. I confess I had also cast my eye over the resulting output (old habits die hard <img src='http://gregs.tcias.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) and finally running a one line deployment to Heroku. Job done and once again a pleasure and full of confidence about the result.</p>
<p>Where there any downsides? Well not downsides, but hiccups, wrapping my head around RVM and gem management was a bit bewildering especially when some gems were being used unexpectedly, the problem lay with what's between the chair and the keyboard. Some of the RSpec view testing tripped me up. When you decide to test the content of views, eg:</p>
<div class="igBar"><span id="lcode-20"><a href="#" onclick="javascript:showPlainTxt('code-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-20">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">response.<span style="">should</span> have_selector<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"title"</span>, :content =&gt; <span style="color:#CC0000;">"Something"</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Don't forget to include render_views after your describe statement for the controller, or else your tests will fail and you will be be scratching your head as to why that is the case. :S</p>
<p>There's a lot to take in and it is a little overwhelming when things do not work as intended, but the information to resolve these is out there and with a careful reading of the error messages it does not take very long to figure out.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2011/02/17/ruby-rails-git-and-heroku/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Stubbie has moved</title>
		<link>http://gregs.tcias.co.uk/2010/11/10/project-stubbie-has-moved/</link>
		<comments>http://gregs.tcias.co.uk/2010/11/10/project-stubbie-has-moved/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 14:05:42 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[stubbie]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[stubs]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=556</guid>
		<description><![CDATA[Yesterday I decided to move Stubbie away from RIAforge. It has nothing to do with RIAForge, I just decided to use Git and as a result move it to Github. Since Github basically provides all the tools, there was no &#8230; <a href="http://gregs.tcias.co.uk/2010/11/10/project-stubbie-has-moved/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday I decided to move <a href="https://github.com/gregstewart/stubbie">Stubbie</a> away from <ahref="http://riaforge.com/">RIAforge</a>. It has nothing to do with RIAForge, I just decided to use Git and as a result move it to <a href="https://github.com/">Github</a>. Since Github basically provides all the tools, there was no need to keep anything on RIAForge. I moved the blog posts over to this blog and you can find them under the <ahref="http://gregs.tcias.co.uk/category/comps/tdd/stubbie/">stubbie category</a>. Over the coming days I aim to add some content to the <a href="https://github.com/gregstewart/stubbie/wiki">Wiki</a>.</p>
<p>I also added a few new features:</p>
<ul>
<li>a mach-ii plugin - so that stubs are recreated if needed on each request</li>
<li>ColdSpring integration for autowiring the objects in your test stubs (which can also make use of the Mach-ii ColdSpring plugin to that end)</li>
<li>Due to the Mach-ii CS integration I added a remote Facade for use with MXUnit (in order to access the application scope)</li>
</ul>
<p>It's all a little experimental at this stage and I'd be interested in your experience with the code, feedback, etc... Feel free to drop me a note or <a href="https://github.com/gregstewart/stubbie/issues">raise tickets</a> over @ Github with your feedback or bugs or suggestions. Alternatively, just leave a comment here. </p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2010/11/10/project-stubbie-has-moved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s been years&#8230;</title>
		<link>http://gregs.tcias.co.uk/2010/06/23/its-been-years/</link>
		<comments>http://gregs.tcias.co.uk/2010/06/23/its-been-years/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 15:33:05 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[stubbie]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[stubs]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=552</guid>
		<description><![CDATA[...between updates. But based of a short conversation with Jon Farrar, I got round to adding mxunit support. I also tidied up a few things in the code for rendering the CFCs and fixed an issue with the VarScopeChecker not &#8230; <a href="http://gregs.tcias.co.uk/2010/06/23/its-been-years/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>...between updates. But based of a short conversation with Jon Farrar, I got round to adding mxunit support. </p>
<p>I also tidied up a few things in the code for rendering the CFCs and fixed an issue with the VarScopeChecker not being picked up by MXUnit.</p>
<p>As always feedback is most welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2010/06/23/its-been-years/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project update</title>
		<link>http://gregs.tcias.co.uk/2007/10/08/project-update/</link>
		<comments>http://gregs.tcias.co.uk/2007/10/08/project-update/#comments</comments>
		<pubDate>Mon, 08 Oct 2007 15:32:06 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[stubbie]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[stubs]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=550</guid>
		<description><![CDATA[It's been for ever and a day, since I have done any commits to this project, but prompted by Janet's comments I have made a handful of commits to the repository. cfUnit is now supported A fix for cfmx 6.1 &#8230; <a href="http://gregs.tcias.co.uk/2007/10/08/project-update/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It's been for ever and a day, since I have done any commits to this project, but prompted by Janet's comments I have made a handful of commits to the repository.</p>
<ol>
<li>cfUnit is now supported</li>
<li>A fix for cfmx 6.1 and recursive directory lookups</li>
<li>The code can now handle missing tearDown methods in existing test cfcs.</li>
</ol>
<p>I have also tried to simplify the config.xml file a little and here's what the default looks like:</p>
<div class="igBar"><span id="lcode-23"><a href="#" onclick="javascript:showPlainTxt('code-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-23">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;stubbie&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;config&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;appName value=<span style="color:#CC0000;">"myMapping"</span> /&gt;&lt;!-- the name of your app, can be the mapping name as set up in cfadmin --&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;appPath value=<span style="color:#CC0000;">"/my/full/path/to/the code/"</span> /&gt;&lt;!--full path to the app --&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;packageRoot value=<span style="color:#CC0000;">""</span> /&gt;&lt;!-- if you have a mapping for your app<span style="color:#CC0000;">'s cfcs, e.g. com.mydomain, specify it here (if you have specified an app name the result will be com.mydomain.myapp) --&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;saveTestFilesTo value=&quot;&quot; /&gt;&lt;!-- Not implemented yet, optional storage location for the test stubs --&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;unitTestFramework value=&quot;cfcUnit&quot;/&gt;&lt;!-- cfcUnit/cfUnit --&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;coldSpring use=&quot;false&quot; path=&quot;config/cs.xml&quot;/&gt;&lt;!-- (working on it) whether or not to use CS and if so where is the cs config file in relation to the app path --&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &lt;/config&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&lt;/stubbie&gt; </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>A concrete example usually works best, so:</p>
<div class="igBar"><span id="lcode-24"><a href="#" onclick="javascript:showPlainTxt('code-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-24">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;stubbie&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;config&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;appName value=<span style="color:#CC0000;">"art"</span> /&gt;&lt;!-- the name of your app, can be the mapping name as set up in cfadmin --&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;appPath value=<span style="color:#CC0000;">"/Users/gregstewart/Sites/Client X sites/Fusebox/ART2/"</span> /&gt;&lt;!--full path to the app --&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;packageRoot value=<span style="color:#CC0000;">""</span> /&gt;&lt;!-- if you have a mapping for your app<span style="color:#CC0000;">'s cfcs, e.g. com.mydomain, specify it here (if you have specified an app name the result will be com.mydomain.myapp) --&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;saveTestFilesTo value=&quot;&quot; /&gt;&lt;!-- Not implemented yet, optional storage location for the test stubs --&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;unitTestFramework value=&quot;cfcUnit&quot;/&gt;&lt;!-- cfcUnit/cfUnit --&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;coldSpring use=&quot;false&quot; path=&quot;config/cs.xml&quot;/&gt;&lt;!-- (working on it) whether or not to use CS and if so where is the cs config file in relation to the app path --&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &lt;/config&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&lt;/stubbie&gt; </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><em>appName</em> : This now refers to a cf mapping in the administrator for my project, in this case art, however if you are using a package approach (with say a value of "com.domain"), then this value would simply be appended to the packageRoot (e.g. com.domain.art)</p>
<p><em>appPath</em> : This is now the full path to the application, e.g. on my local machine /Users/gregstewart/Sites/Client X sites/Fusebox/ART2/</p>
<p><em>packageRoot</em> : Hasn't changed</p>
<p><em>saveTestFilesTo</em> : Hasn't changed</p>
<p><em>unitTestFramework</em> : Now supports cfUnit.</p>
<p><em>coldSpring</em> : Something working on, i.e. use ColdSpring to generate mock objects. Could be ages before it sees the light of day, if my past track record is anything to go by.</p>
<p>Thoughts and suggestions are still most welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2007/10/08/project-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wikipedia&#8217;s TDD entry</title>
		<link>http://gregs.tcias.co.uk/2007/05/28/wikipedias-tdd-entry/</link>
		<comments>http://gregs.tcias.co.uk/2007/05/28/wikipedias-tdd-entry/#comments</comments>
		<pubDate>Mon, 28 May 2007 15:05:01 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=548</guid>
		<description><![CDATA[Wikipedia's page on Test-Driven development (TDD), provides an excellent overview of the purpose of TDD, it's advantages and shortcomings.]]></description>
			<content:encoded><![CDATA[<p>Wikipedia's page on <a href="http://en.wikipedia.org/wiki/Test-driven_development" title="Test-driven development">Test-Driven development</a> (TDD), provides an excellent overview of the purpose of TDD, it's advantages and shortcomings.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2007/05/28/wikipedias-tdd-entry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More unit testing generator projects</title>
		<link>http://gregs.tcias.co.uk/2007/05/28/more-unit-testing-generator-projects/</link>
		<comments>http://gregs.tcias.co.uk/2007/05/28/more-unit-testing-generator-projects/#comments</comments>
		<pubDate>Mon, 28 May 2007 15:03:59 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[stubbie]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[stubs]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=546</guid>
		<description><![CDATA[Finally managed to catch up on a few blog posts this week after another project deadline has passed and I came across two more projects that have started to generate unit tests for you: Squidhead and CFUnit Stub Generator for &#8230; <a href="http://gregs.tcias.co.uk/2007/05/28/more-unit-testing-generator-projects/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Finally managed to catch up on a few blog posts this week after another project deadline has passed and I came across two more projects that have started to generate unit tests for you:</p>
<ul>
<li><a href="http://www.numtopia.com/terry/blog/archives/2007/05/squidhead_and_cfunit.cfm" title="Squidhead and CFUnit">Squidhead and CFUnit</a></li>
<li><a href-"http://www.briankotek.com/blog/index.cfm/2007/5/16/Stub-Generator-for-CFCs-Unit-Tests-and-More" title="Stub Generator for CFCs, Unit Tests, and More">Stub Generator for CFCs, Unit Tests, and More</a></li>
</ul>
<p>Both projects do a hell of a lot more than just create test objects though. Definitely worth checking out.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2007/05/28/more-unit-testing-generator-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>For those 11 folks&#8230;</title>
		<link>http://gregs.tcias.co.uk/2007/05/10/for-those-11-folks/</link>
		<comments>http://gregs.tcias.co.uk/2007/05/10/for-those-11-folks/#comments</comments>
		<pubDate>Thu, 10 May 2007 05:21:27 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[stubbie]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[stubs]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=543</guid>
		<description><![CDATA[...who so far downloaded the code. I'd be pleased to hear from you, if you have had a chance to install it and run it. I am especially interested in the experience so far, any issues, such as unclear install &#8230; <a href="http://gregs.tcias.co.uk/2007/05/10/for-those-11-folks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>...who so far downloaded the code. I'd be pleased to hear from you, if you have had a chance to install it and run it. I am especially interested in the experience so far, any issues, such as unclear install instructions, config problems, calling the CFC and of course any bugs.</p>
<p>Feel free to comment here, use the <a href="http://stubbie.riaforge.org/forums/forums.cfm?conferenceid=244FF9F0-C349-4B5E-BBD4027EF42E3B62"  title="Stubbie forums">forums</a> or even log an issue with the <a href="http://stubbie.riaforge.org/index.cfm?event=page.issues"  title="Issue tracker">tracker</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2007/05/10/for-those-11-folks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion repository is available</title>
		<link>http://gregs.tcias.co.uk/2007/05/10/subversion-repository-is-available/</link>
		<comments>http://gregs.tcias.co.uk/2007/05/10/subversion-repository-is-available/#comments</comments>
		<pubDate>Thu, 10 May 2007 05:16:09 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[stubbie]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[stubs]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=541</guid>
		<description><![CDATA[I finally got round to setting up the Subversion (SVN) repository today. So if you feel like living dangerously you can grab the source from SVN trunk.]]></description>
			<content:encoded><![CDATA[<p>I finally got round to setting up the Subversion (SVN) repository today. So if you feel like living dangerously you can grab the source from <a href="http://svn.riaforge.org/stubbie/trunk" title="Subversion Trunk folder">SVN trunk</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2007/05/10/subversion-repository-is-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

