<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>agilewebdevelopmentwithrails &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/agilewebdevelopmentwithrails/</link>
	<description>Feed of posts on WordPress.com tagged "agilewebdevelopmentwithrails"</description>
	<pubDate>Wed, 10 Feb 2010 06:34:49 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Writing Tests for Rails Plugins]]></title>
<link>http://blog.deadinkvinyl.com/2008/05/03/writing-tests-for-rails-plugins/</link>
<pubDate>Sat, 03 May 2008 22:28:28 +0000</pubDate>
<dc:creator>dlkinney</dc:creator>
<guid>http://blog.deadinkvinyl.com/2008/05/03/writing-tests-for-rails-plugins/</guid>
<description><![CDATA[I really like The Rails Way by Obie Fernandez. It&#8217;s not an introduction to using Rails&#8212;l]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I really like <a href="http://www.amazon.com/dp/0321445619/?tag=deadinkvinyl-20">The Rails Way</a> by Obie Fernandez. It&#8217;s not an introduction to using Rails&#8212;look to <a href="http://www.pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition">Agile Web Development with Rails</a> and <a href="http://www.amazon.com/dp/0321480791/?tag=deadinkvinyl-20">RailsSpace</a> for that. Instead, <em>The Rails Way</em> was written as a &#8220;day-to-day reference for the full-time Rails developer&#8221; (page <em>liv</em>) and weighs in at a hefty 851 pages, plus the preface material. It has served me well so far and it is the first resource I pick up when I need to delve into a new area of Rails development. </p>
<p>When I needed to develop a model plugin for Rails, <em>The Rails Way</em> provided an excellent overview of the process. Between that and a review of <a href="http://agilewebdevelopment.com/plugins/acts_as_taggable_on_steroids">acts_as_taggable_on_steroids</a>, I was able to get my plugin up and running very quickly. Then I wondered about writing tests for the plugin so that I can have confidence it continues to work when I upgrade to the next version of Rails. For the first time, <em>The Rails Way</em> failed me: </p>
<blockquote>
<p>As you can imagine, testing of plugins is a lengthy topic that is primarily of interest to plugin authors. Unfortunately, I must leave further analysis of the subject out of this book for reasons of practicality and overall length. (page 649)</p>
</blockquote>
<p>The book already has 851 pages, but another dozen couldn&#8217;t be spared for this topic? How does that work? In all seriousness, I wasn&#8217;t overly upset&#8212;I understand that there are limits to what can be included in a book. I would have written it off as a minor inconvenience, but I couldn&#8217;t find any good Web sites that covered the topic well. Additionally, the tests that were included with the plugins I downloaded were a bit on the lean side and didn&#8217;t provide a good example from which to work. </p>
<p>Fortunately, <a href="http://peepcode.com/">PeepCode</a> came to my rescue. PeepCode has an excellent PDF about <a href="http://peepcode.com/products/rails-2-plugin-patterns">writing Rails plugins</a>. It covers the common patterns for each flavor of plugin and is very thorough in its explanation about why the code is written in the manner described. It&#8217;s over 100 pages long, so I haven&#8217;t finished it yet&#8212;or even gotten to the section on writing plugin tests&#8212;but it has already proven to be the best resource I&#8217;ve found concerning Rails 2 plugins. I recommend it without hesitation for anyone seeking to write their own plugin or understand someone else&#8217;s plugin. </p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
