<?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>McKinney Station &#187; RSpec</title>
	<atom:link href="http://www.mckinneystation.com/categories/rspec/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mckinneystation.com</link>
	<description>Ruby on Rails web application development for Dallas/Fort Worth and all of North Texas.</description>
	<lastBuildDate>Wed, 02 Sep 2009 14:29:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>test/spec docs for Rails</title>
		<link>http://www.mckinneystation.com/2008/02/24/testspec-docs-for-rails/</link>
		<comments>http://www.mckinneystation.com/2008/02/24/testspec-docs-for-rails/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 06:35:08 +0000</pubDate>
		<dc:creator>Geoffrey</dc:creator>
				<category><![CDATA[RSpec]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[test/spec]]></category>

		<guid isPermaLink="false">http://www.mckinneystation.com/2008/02/24/testspec-docs-for-rails/</guid>
		<description><![CDATA[photo by Kriston Lewis
I am a big RSpec fan.  But occasionally, I work on projects that use test/spec.  When I want output the spec documentation with RSpec, I just use rake spec:doc.  With test/spec, I couldn&#8217;t find such a thing.  So I made one and stuck it in lib/tasks/test_spec.rake

Rake::TestTask.new(:specdox) do &#124;t&#124;
 [...]]]></description>
			<content:encoded><![CDATA[<div class="shadow right"><img src='http://www.mckinneystation.com/wp-content/uploads/2008/02/map.jpg' alt='map' /><br/><span class="credit">photo by <a href="http://flickr.com/photos/87634257@N00/">Kriston Lewis</a></span></div>
<p>I am a big <a href="http://rspec.info">RSpec</a> fan.  But occasionally, I work on projects that use <a href="http://test-spec.rubyforge.org/">test/spec</a>.  When I want output the spec documentation with RSpec, I just use <code>rake spec:doc</code>.  With test/spec, I couldn&#8217;t find such a thing.  So I made one and stuck it in <code>lib/tasks/test_spec.rake</code></p>
<p><br  class="clearfix" /></p>
<pre><code>Rake::TestTask.new(:specdox) do |t|
  t.options = '--runner=specdox'
  t.libs &lt;&lt; 'test'
  t.pattern = 'test/**/*_test.rb'
  t.verbose = true
end
Rake::Task[:specdox].comment = "Generate specdox."</code></pre>
<p>Now I can use <code>rake specdox</code> to see all the wonderful spec documentation!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mckinneystation.com/2008/02/24/testspec-docs-for-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dallas.rb Presentation</title>
		<link>http://www.mckinneystation.com/2008/02/05/dallasrb-presentation/</link>
		<comments>http://www.mckinneystation.com/2008/02/05/dallasrb-presentation/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 02:37:05 +0000</pubDate>
		<dc:creator>Geoffrey</dc:creator>
				<category><![CDATA[Dallas]]></category>
		<category><![CDATA[RSpec]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.mckinneystation.com/2008/02/05/dallasrb-presentation/</guid>
		<description><![CDATA[photo by vitalyzator
I presented on RSpec 1.1 tonight at the Dallas.rb.  I don&#8217;t claim to be an expert, I just love my specs (and now stories).
Feel free to take a look at the slides.
]]></description>
			<content:encoded><![CDATA[<div class="shadow left"><img src='http://www.mckinneystation.com/wp-content/uploads/2008/02/62012133_17e9735f1f_m.jpg' alt='Train graffiti' /><br/><span class="credit">photo by <a href="http://www.flickr.com/photos/70475110@N00/">vitalyzator</a></span></div>
<p>I presented on <a href="http://rspec.info">RSpec 1.1</a> tonight at the <a href="http://www.dallasrb.org">Dallas.rb</a>.  I don&#8217;t claim to be an expert, I just love <a href="http://rspec.info/examples.html">my specs</a> (<a href="http://rspec.info/documentation/stories.html">and now stories</a>).</p>
<p>Feel free to take a look at <a href='http://www.mckinneystation.com/wp-content/uploads/2008/02/dallasrb-2008-02-05.pdf' title='RSpec 1.1 PDF from Dallas.rb'>the slides</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mckinneystation.com/2008/02/05/dallasrb-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FixtureReplacement in script/console</title>
		<link>http://www.mckinneystation.com/2008/01/10/fixturereplacement-in-scriptconsole/</link>
		<comments>http://www.mckinneystation.com/2008/01/10/fixturereplacement-in-scriptconsole/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 15:54:07 +0000</pubDate>
		<dc:creator>Geoffrey</dc:creator>
				<category><![CDATA[RSpec]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.mckinneystation.com/2008/01/10/fixturereplacement-in-scriptconsole/</guid>
		<description><![CDATA[photo by laffy4k
So I came across Dan Manges Fixture Factory as a way to relieve myself of the pain of fixtures for testing.  I don&#8217;t mind fixtures that much, but when I have to start setting up so many different combinations, it gets a little challenging.   In reading through the comments I [...]]]></description>
			<content:encoded><![CDATA[<div class="shadow left"><img src='http://www.mckinneystation.com/wp-content/uploads/2008/01/metra.jpg' alt='metra' /><br/><span class="credit">photo by <a href="http://www.flickr.com/photos/laffy4k/">laffy4k</a></span></div>
<p>So I came across <a href="http://www.dcmanges.com">Dan Manges</a> <a href="http://www.dcmanges.com/blog/38">Fixture Factory</a> as a way to relieve myself of the pain of fixtures for testing.  I don&#8217;t mind fixtures that much, but when I have to start setting up so many different combinations, it gets a little challenging.   In reading through the comments I found that  <a href="http://railsnewbie.com/">Scott Taylor</a> had <a href="http://replacefixtures.rubyforge.org/">implemented it as a plugin</a>.  Now I get all that goodness for my <a href="http://rspec.rubyforge.org">specs</a>.</p>
<p class="clearfix" >
The other day I wanted to play with some things using <code>script/console</code>, but was feeling too lazy to set up all of the data I was going to need to do what I wanted.  Sure enough after looking at the documentation for fixture_replacement, I can use it there too:
</p>
<pre>
<code>  % script/console
  &gt;&gt; include FixtureReplacement
  &gt;&gt; cause = create_cause
  &gt;&gt; user = create_user
  &gt;&gt; cause.users &lt;&lt; user </code>
</pre>
<p>It is really useful for easily setting up your test data in the spec (or test) that you are writing. Instead of having to go off to the fixture files and add new fixtures (and try to remember to set up all of the dependent fixtures that are needed), you can use new_xxx or create_xxx to get an object to test in a valid state with all its dependent data.  </p>
<p>Take a look at the <a href="http://replacefixtures.rubyforge.org/">FixtureReplacement plugin</a> now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mckinneystation.com/2008/01/10/fixturereplacement-in-scriptconsole/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RESTful Rails and Dreamhost</title>
		<link>http://www.mckinneystation.com/2007/12/17/restful-rails-and-dreamhost/</link>
		<comments>http://www.mckinneystation.com/2007/12/17/restful-rails-and-dreamhost/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 17:33:03 +0000</pubDate>
		<dc:creator>Geoffrey</dc:creator>
				<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[RSpec]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.mckinneystation.com/2007/12/17/restful-rails-and-dreamhost/</guid>
		<description><![CDATA[photo by woodleywonderworks

I recently upgraded StagingTracks.com to use Rails 2.0.  I was excited about so many of the newest features that it seemed the logical thing to do.  I even decided to upgrade RSpec in the process so I would be able to play with some of the new features there too.  [...]]]></description>
			<content:encoded><![CDATA[<div class="shadow right"><img src='http://www.mckinneystation.com/wp-content/uploads/2007/12/train_wreck.jpg' alt='Train Wreck' /><br/><span class="credit">photo by <a href="http://flickr.com/photos/wwworks/">woodleywonderworks</a><br />
</span></div>
<p>I recently upgraded <a href="http://www.stagingtracks.com">StagingTracks.com</a> to use <a href="http://weblog.rubyonrails.com/2007/12/7/rails-2-0-it-s-done">Rails 2.0</a>.  I was excited about so many of the newest features that it seemed the logical thing to do.  I even decided to upgrade <a href="http://rspec.rubyforge.org">RSpec</a> in the process so I would be able to play with <a href="http://blog.davidchelimsky.net/articles/2007/12/14/rspec-1-1">some of the new features</a> there too.  </p>
<p>Unfortunately, despite extensive local spec&#8217;ing, when I <a href="http://capify.org/">deployed the app</a> to Dreamhost, <a href="http://www.stagingtracks.com/posts/view/a_minor_glitch">things did not go as planned</a>.  I was using <a href="http://piston.rubyforge.org/">piston to manage my Rails in the app and all of my plugins</a>, so I didn&#8217;t need to worry about which gems were installed on the server.  What I found was that when users tried to submit new information using the forms on the site, nothing would happen.  Let me correct that: It would look like something happened, but no data was submitted.</p>
<h2>So what was the problem?</h2>
<p>I first started by watching the <code>production.log</code> to see if the data was even getting submitted.  As expected, nothing was coming through.  I then used the <a href="https://addons.mozilla.org/firefox/addon/966">Tamper Data plugin</a> for Firefox to see if I if the data was getting out of the browser.  It was, but something interesting appeared.  I saw a 301 Redirect when the page was submitted.  Odd.  Especially since the application wasn&#8217;t seeing the data and there were no redirects in the production.log.  </p>
<p>So I started looking in the http <code>access.log</code> to see why the data wasn&#8217;t coming through to the app.  What I saw was surprising:</p>
<pre>
<code>- - [16/Dec/2007:19:24:30 -0800] "POST /shops HTTP/1.1" 301 591 "http://www.stagingtracks.com/shops/new" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"
- - [16/Dec/2007:19:24:30 -0800] "GET /shops/ HTTP/1.1" 200 319 "http://www.stagingtracks.com/shops/new" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"</code></pre>
<p>It looked like the POST (which goes to the &#8216;create&#8217; method using Rails RESTful approach) was being redirected to &#8216;/shops/&#8217;.  The browser would then call &#8216;/shops/ &#8216; with a GET (which is the &#8216;index&#8217; action).  And the form submission never got through.  Now I was perplexed.  Why would the web server being sending the 301 Redirect?</p>
<p>It became a little clearer when I saw this in the logs as well:</p>
<pre>
<code>- - [16/Dec/2007:19:15:11 -0800] "GET /shops HTTP/1.1" 301 591 "http://www.stagingtracks.com/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"
- - [16/Dec/2007:19:15:11 -0800] "GET /shops/ HTTP/1.1" 200 89174 "http://www.stagingtracks.com/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"</code></pre>
<p>For some reason, the web server was causing 301 Redirects when the trailing slash was missing!  Now I had heard of <a href="http://www.google.com/search?q=trailing+slash+rails">the trailing slash problem</a>, but couldn&#8217;t find a suitable solution that would be easy to implement.</p>
<h2>So How Do You Fix It?</h2>
<p>I am so glad I am surrounded by lots of smart people.  A quick conversation with my friend <a href="http://robsanheim.com/">Rob Sanheim</a> turned up <a href="http://mephisto.stikipad.com/help/show/Developer+Tips">the solution</a>.  </p>
<p>I added the following to my <code>.htaccess</code> file:</p>
<pre>
<code>DirectorySlash Off</code>
</pre>
<p>I added it after the <code>Options +FollowSymLinks +ExecCGI</code> and before the <code>RewriteEngine On</code></p>
<p>Now things are back to normal again.  I am now able to get back to <a href="http://www.stagingtracks.com">connecting model railroaders</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mckinneystation.com/2007/12/17/restful-rails-and-dreamhost/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ping Pong at the Dallas.rb</title>
		<link>http://www.mckinneystation.com/2007/11/08/ping-pong-at-the-dallasrb/</link>
		<comments>http://www.mckinneystation.com/2007/11/08/ping-pong-at-the-dallasrb/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 02:22:29 +0000</pubDate>
		<dc:creator>Geoffrey</dc:creator>
				<category><![CDATA[Dallas]]></category>
		<category><![CDATA[RSpec]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.mckinneystation.com/2007/11/08/ping-pong-at-the-dallasrb/</guid>
		<description><![CDATA[photo by chick_e_pooo

Last night, Adam Keys and I did a little ping pong pairing for the Dallas.rb meeting.  It was fun.  Of course it highlighted how much I have to jump back to the Ruby docs to get much done.  But I don&#8217;t see that as a problem, since it leaves more [...]]]></description>
			<content:encoded><![CDATA[<div class="shadow right"><img src='http://www.mckinneystation.com/wp-content/uploads/2007/11/pingpong.jpg' alt='ping pong' /><br/><span class="credit">photo by <a href="http://www.flickr.com/photos/chickie-poo/">chick_e_pooo</a><br/><br/><br />
</span></div>
<p>Last night, <a href="http://www.therealadam.com">Adam Keys</a> and I did a little <a href="http://c2.com/cgi/wiki?PairProgrammingPingPongPattern">ping pong pairing</a> for <a href="http://www.dallasrb.org">the Dallas.rb meeting</a>.  It was fun.  Of course it highlighted how much I have to jump back to <a href="http://www.rubybrain.com">the Ruby docs</a> to get much done.  But I don&#8217;t see that as a problem, since it leaves more room in my head for other things.  It also showed my lack of regex-fu.</p>
<p>Here is <a href="http://groups.google.com/group/dallasrb/browse_thread/thread/83005bf4dc9dac6a">the code we worked on</a>.  We were trying to solve <a href="http://www.rubyquiz.com/quiz122.html">the Ruby Quiz Credit Card problem</a>, and got most of the way through.  The fun part about pairing was bouncing ideas off of each other.  Others in attendance were also helpful with their suggestions.  It was especially interesting as we looked back over the code and discussed even more ways to clean it up.</p>
<p>Would I do it again?  You bet.  But I think next time, I would like to work on something that I am more comfortable with, like a Rails related app.  <a href="http://www.mckinneystation.com/2007/04/25/specify-first-test-last-if-ever/">I love writing specs for that.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mckinneystation.com/2007/11/08/ping-pong-at-the-dallasrb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presenting RSpec at Dallas.rb</title>
		<link>http://www.mckinneystation.com/2007/08/07/presenting-rspec-at-dallasrb/</link>
		<comments>http://www.mckinneystation.com/2007/08/07/presenting-rspec-at-dallasrb/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 16:56:18 +0000</pubDate>
		<dc:creator>Geoffrey</dc:creator>
				<category><![CDATA[Dallas]]></category>
		<category><![CDATA[RSpec]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Web Applications]]></category>

		<guid isPermaLink="false">http://www.mckinneystation.com/2007/08/07/presenting-rspec-at-dallasrb/</guid>
		<description><![CDATA[photo by alangbrf

I will give a presentation on RSpec and Behaviour Driven Development at the Dallas.rb tonight (August 8).  Stop by and find out more.
]]></description>
			<content:encoded><![CDATA[<div class="shadow left"><img src='http://www.mckinneystation.com/wp-content/uploads/2007/08/thalys.jpg' alt='Thalys' /><br/><span class="credit">photo by <a href="http://flickr.com/photos/alandesitter/">alangbrf</a></credit>
</div>
<p>I will give a presentation on <a href="http://rspec.rubyforge.org">RSpec</a> and <a href="http://behavior-driven.org">Behaviour Driven Development</a> at the <a href="http://www.dallasrb.org">Dallas.rb</a> tonight (August 8).  Stop by and find out more.</p>
<div class="clearfix"<br />
<strong>Update</strong></p>
<p><a href='http://www.mckinneystation.com/wp-content/uploads/2007/08/dallasrb-2007-08-08.pdf' title='BDD and RSpec Presentation'>BDD and RSpec Presentation (PDF)</a></p>
<ul>
<li><a href="http://rspec.rubyforge.org">RSpec</a></li>
<li><a href="http://www.zenspider.com/ZSS/Products/ZenTest/">ZenTest (Autotest)</a></li>
<li><a href="http://rubyforge.org/projects/rcov/">rcov</a></li>
<li><a href="http://www.openqa.org/">Selenium/ Watir</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mckinneystation.com/2007/08/07/presenting-rspec-at-dallasrb/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rails Development Environment in Ubuntu</title>
		<link>http://www.mckinneystation.com/2007/05/08/rails-development-environment-in-ubuntu/</link>
		<comments>http://www.mckinneystation.com/2007/05/08/rails-development-environment-in-ubuntu/#comments</comments>
		<pubDate>Tue, 08 May 2007 14:59:20 +0000</pubDate>
		<dc:creator>Geoffrey</dc:creator>
				<category><![CDATA[Averatec]]></category>
		<category><![CDATA[Development Environment]]></category>
		<category><![CDATA[Entrepreneurial]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[RSpec]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[fastercsv]]></category>
		<category><![CDATA[hpricot]]></category>
		<category><![CDATA[mongrel]]></category>
		<category><![CDATA[starfish]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.mckinneystation.com/2007/05/08/rails-development-environment-in-ubuntu/</guid>
		<description><![CDATA[photo by zruvalcaba
After my last post, I thought I would share what I use for developing on Ubuntu.
Editor
I have always been a hands-on kinda guy, so I don&#8217;t use any of the fancy IDEs.  Right now, I am using SciTE for two reasons.  It feels lightweight and it is available for Linux and [...]]]></description>
			<content:encoded><![CDATA[<div class="shadow right"><img src='http://www.mckinneystation.com/wp-content/uploads/2007/05/goat_canyon_trestle.jpg' alt='Goat Canyon Trestle' /><br/><span class="credit">photo by <a href="http://www.sxc.hu/profile/zruvalcaba">zruvalcaba</a></span></div>
<p>After <a href="http://www.mckinneystation.com/2007/05/08/and-that-is-why-you-have-backups/">my last post</a>, I thought I would share what I use for developing on <a href="http://www.ubuntu.com">Ubuntu</a>.</p>
<h2>Editor</h2>
<p>I have always been a hands-on kinda guy, so I don&#8217;t use any of the <a href="http://www.aptana.com/">fancy</a> <a href="http://www.jetbrains.com/idea/index.html">IDEs</a>.  Right now, I am using <a href="http://www.scintilla.org/SciTE.html">SciTE</a> for two reasons.  It feels lightweight and it is available for Linux and Windows.  Since <a href="http://www.averatec.com/products/portable/thinlight/3200Series.asp">my laptop</a> does not have a lot of memory, a lightweight editor is a must.  I tried <a href="http://www.eclipse.org/">Eclipse</a>, but it chewed up all my memory and slowed things to a crawl.  So SciTE with <a href="http://caladbolg.net/scite.php">some additional plugins</a> (and <a href="http://mondaybynoon.com/2007/03/12/using-scite-with-textmate-style-snippets/">information on getting them going</a>) powers <a href="http://www.mckinneystation.com/projects">the development at McKinney Station</a>.</p>
<h2>Ruby and Rails</h2>
<p>I am using the latest <a href="http://www.ruby-lang.org/en/">Ruby</a> and <a href="http://www.rubyonrails.com">Rails</a> for all new development.  For testing I am using <a href="http://rspec.rubyforge.org">RSpec</a>, which seems <a href="http://www.mckinneystation.com/2007/04/25/specify-first-test-last-if-ever/">a lot more intuitive to me</a>.  Other <a href="http://rubygems.org/">gems</a> I  have installed include:</p>
<ul>
<li><a href="http://fastercsv.rubyforge.org/">FasterCSV</a> &#8211; parsing CSV files</li>
<li><a href="http://tech.rufy.com/2006/08/mapreduce-for-ruby-ridiculously-easy.html">starfish</a> &#8211; simple Ruby Map/Reduce</li>
<li><a href="http://mongrel.rubyforge.org/">mongrel</a> &#8211; lightweight Ruby web server</li>
<li><a href="http://code.whytheluckystiff.net/hpricot/">hpricot</a> &#8211; Ruby HTML parser</li>
</ul>
<h2>Database</h2>
<p>I love starting all of my development projects with SQLite.  It is <a href="http://wiki.rubyonrails.org/rails/pages/HowtoUseSQLite">so easy to get up and running</a>.   As the project matures, I am able to quickly switch development over to a MySQL database with a change in the application&#8217;s database configuration and a quick <code>rake db:migrate</code>.</p>
<h2>Version Control</h2>
<p>All source code versioning is done with Subversion.  With <a href="http://www.railsonwave.com/railsonwave/2006/12/19/smart-subversion-script-for-rails-projects">this quick little script</a>, I can get a Rails project committed and started in minutes.</p>
<h2>Conclusion</h2>
<p>I am always looking for ways to speed up my development process, but so far this is working for me.  And it is very enjoyable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mckinneystation.com/2007/05/08/rails-development-environment-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Specify First, Test Last (if ever)</title>
		<link>http://www.mckinneystation.com/2007/04/25/specify-first-test-last-if-ever/</link>
		<comments>http://www.mckinneystation.com/2007/04/25/specify-first-test-last-if-ever/#comments</comments>
		<pubDate>Wed, 25 Apr 2007 15:19:10 +0000</pubDate>
		<dc:creator>Geoffrey</dc:creator>
				<category><![CDATA[RSpec]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Web Applications]]></category>

		<guid isPermaLink="false">http://www.mckinneystation.com/2007/04/25/specify-first-test-last-if-ever/</guid>
		<description><![CDATA[

photo by bjearwicke

I have come across a few situations recently where testing is a second class citizen in the development process.  The latest was a job posting where the part of the development environment was described as &#8220;testing when possible.&#8221;  A lot of the larger projects I have worked on have 1 or [...]]]></description>
			<content:encoded><![CDATA[<div class="shadow right">
<img src='http://www.mckinneystation.com/wp-content/uploads/2007/04/locomotive.jpg' alt='Upclose Locomotive' /><span class="credit"><br />
photo by <a href="http://www.sxc.hu/profile/bjearwicke">bjearwicke</a></span>
</div>
<p>I have come across a few situations recently where testing is a second class citizen in the development process.  The latest was a job posting where the part of the development environment was described as &#8220;testing when possible.&#8221;  A lot of the larger projects I have worked on have 1 or 2 weeks of testing tacked on to the end of the development cycle.  More times than not, this &#8220;testing&#8221; time becomes padding for development schedules that overrun.  Besides &#8220;you tested as you developed, right?&#8221; and &#8220;we can&#8217;t move the delivery date.&#8221;</p>
<p>I am becoming more and more an advocate of writing automated tests.  This has become even more important when I am the sole developer on a project.  Now you might say to yourself, &#8220;If there is no one else to mess up the code, shouldn&#8217;t everything work?&#8221;  It does work.  But as I come across areas of code that need to be refactored, because I am <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRYing up my code</a>, I want to be sure that my changes do not break existing functionality.  Now I could make the changes and then manually try to test all of the possible scenarios, but I usually miss one or two, especially in more complex applications.  This is where the automated tests come in very handy.</p>
<div class="shadow left"><img src='http://www.mckinneystation.com/wp-content/uploads/2007/04/boy_on_tracks.jpg' alt='Boy on Tracks' /><span class="credit"><br />
photo by <a href="http://www.sxc.hu/profile/mcconnell6">mcconnell6</a></span></div>
<p>Maybe I am thick, but writing tests using <a href="http://www.junit.org">JUnit</a> or <a href="http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html">Test::Unit</a> never seemed natural.  It always seemed to go at the end of my development cycle.  Maybe it was the vocabulary implying that something had to exist to be tested.  Maybe it was the unnatural language of assertions: assertTrue, assertThis, assertThat.  Who talks like that?</p>
<p>Then I came across <a href="http://behaviour-driven.org/">something that encouraged me to write specifications for an application</a> that could then be used after the development was complete to verify that the specifications were met.  All of the sudden I was discussing how the application <em>should</em> behave, which does not imply that the application even exist yet.  This makes sense to me.  I saying things like &#8220;this should equal that&#8221; or &#8220;something should have 5 of these&#8221;.  It is subtle, but powerful.</p>
<p>So I am now using <a href="http://rspec.rubyforge.org">RSpec</a>, the Ruby implementation of Behaviour Driven Development, for all of my projects.  My latest Rails project has only 6 models and 2 controllers, but has over 200 specs.  I have a better understanding of how the application is supposed to behave.  Combine that with <a href="http://blog.nicksieger.com/articles/2006/11/15/rspec-autotest-now-a-rails-plugin">a way to continously re-run the specifications when the code is changed</a> and I am now a lot more confident that my changes aren&#8217;t breaking existing functionality. </p>
<p>Plus, <a href="http://www.robbyonrails.com/articles/2007/02/08/is-bdd-kinkier-than-tdd">it&#8217;s cooler</a>, right?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mckinneystation.com/2007/04/25/specify-first-test-last-if-ever/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
