<?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>Keep Learning &#187; In English</title>
	<atom:link href="http://www.makemesimple.com/blog/category/in-english/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.makemesimple.com/blog</link>
	<description>Conhecimento nunca é o bastante</description>
	<lastBuildDate>Wed, 28 Apr 2010 21:28:04 +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>High Five: five tips on testing with Rails</title>
		<link>http://www.makemesimple.com/blog/2008/05/05/high-five-five-tips-on-testing-with-rails/</link>
		<comments>http://www.makemesimple.com/blog/2008/05/05/high-five-five-tips-on-testing-with-rails/#comments</comments>
		<pubDate>Mon, 05 May 2008 05:48:10 +0000</pubDate>
		<dc:creator>Lucas Húngaro</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[In English]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Test-Driven Development]]></category>

		<guid isPermaLink="false">http://www.makemesimple.com/blog/2008/05/05/high-five-five-tips-on-testing-with-rails/</guid>
		<description><![CDATA[Testing is a very important aspect of Rails programming. The framework makes testing really easy, eliminating some excuses you could have for not testing your applications. Here&#8217;s my five tips for testing with Rails:

Embrace the TDD cycle: this one isn&#8217;t Rails related, but is very important. You can write your code first and test it [...]]]></description>
			<content:encoded><![CDATA[<p>Testing is a very important aspect of Rails programming. The framework makes testing really easy, eliminating some excuses you could have for not testing your applications. Here&#8217;s my five tips for testing with Rails:</p>
<ul>
<li><span class="Apple-style-span" style="font-weight: bold">Embrace the TDD cycle</span>: this one isn&#8217;t Rails related, but is very important. You can write your code first and test it after and you&#8217;ll get some benefits, but <a href="http://en.wikipedia.org/wiki/Test_driven_development" target="_blank">Test-Driven Development</a> really leverages the power of this automated testing. By writing your tests first you get low <a href="http://en.wikipedia.org/wiki/Coupling_(computer_science)" target="_blank">coupling</a> and high <a href="http://en.wikipedia.org/wiki/Cohesion_(computer_science)" target="_blank">cohesion</a> through a better interface (API) design. Moreover, by following the red-green-refactor cycle you&#8217;ll always know when you&#8217;re done and will avoid <a href="http://en.wikipedia.org/wiki/Functionality_creep" target="_blank">scope creep</a>.</li>
<li><span class="Apple-style-span" style="font-weight: bold"><del datetime="2009-08-28T15:31:49+00:00">Test your helpers</span>: plain and simple. <a href="http://www.pragprog.com/titles/fr_rr/rails-recipes" target="_blank">Rais Recipes</a> has a recipe about it and, with Edge Rails, <a href="http://blog.codefront.net/2008/04/20/living-on-the-edge-of-rails-17/" target="_blank">testing helpers got easier</a></del>.</li>
<li><span class="Apple-style-span" style="font-weight: bold">Overmocking results in brittle tests</span>:and brittle tests are a bad thing. Many people just mock and stub everything. By doing this you&#8217;re coupling your tests to the inner details of the tested code instead of the result of its execution. <a href="http://giantrobots.thoughtbot.com/2007/3/17/battle-royale-testing" target="_blank">You can see an example here </a>(and subscribe to that blog&#8217;s feed, it&#8217;s very good).</li>
<li><span class="Apple-style-span" style="font-weight: bold">Watch out on your way to BDD</span>: <a href="http://behaviour-driven.org/" target="_blank">Behavior-Driven Development</a> is in vogue within the Rails community. Be careful. Just like you can <a href="http://www.codinghorror.com/blog/archives/000272.html" target="_blank">write Fortran in any language</a>, you can use something like RSpec and still not do BDD. BDD is about a shift in the way you think about tests, not about tools by themselves. You can use Test::Unit and do BDD. Tools like <a href="http://rspec.info/" target="_blank">RSpec</a> and <a href="http://thoughtbot.com/projects/shoulda" target="_blank">Shoulda</a> (my personal choice) are facilitators, they don&#8217;t guarantee anything.</li>
<li><span class="Apple-style-span" style="font-weight: bold">One assertion per test</span>: this is one of that tips that seems inoffensive but once you&#8217;re doing helps a lot. Why? <a href="http://blog.jayfields.com/2007/06/testing-one-assertion-per-test.html" target="_blank">Jay Fields can explain better than me</a>.</li>
</ul>
<p>And that&#8217;s it. Five quick and simple tips that I hope will help you. Feel free to share your own tips in the comments. This article is my entry to the <a href="http://railscasts.com/contest" target="_blank">Railscasts&#8217; 100th episode contest</a>. Take some time to visit the site, it&#8217;s really good.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemesimple.com/blog/2008/05/05/high-five-five-tips-on-testing-with-rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Contributing: reserved_attributes Rails plugin</title>
		<link>http://www.makemesimple.com/blog/2008/04/07/contributing-reserved_attributes-rails-plugin/</link>
		<comments>http://www.makemesimple.com/blog/2008/04/07/contributing-reserved_attributes-rails-plugin/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 16:37:53 +0000</pubDate>
		<dc:creator>Lucas Húngaro</dc:creator>
				<category><![CDATA[In English]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.makemesimple.com/blog/2008/04/07/contributing-reserved_attributes-rails-plugin/</guid>
		<description><![CDATA[Here&#8217;s my first contribution to the Rails community: the reserved_attributes plugin.
The plugin is very simple, just adding a rake task to your project. The task scans all your models checking its attributes (columns) and warning you if any of them have a name that are a Ruby/Rails reserved word.
Some time ago I spent about 8 [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s my first contribution to the Rails community: <a href="http://github.com/lucashungaro/reserved_attributes/tree/master" target="_blank">the reserved_attributes plugin</a>.</p>
<p>The plugin is very simple, just adding a rake task to your project. The task scans all your models checking its attributes (columns) and warning you if any of them have a name that are a Ruby/Rails reserved word.</p>
<p>Some time ago I spent about 8 hours of work because my unit tests was breaking with a very strange error (and a gigantic trace). It turns out that I was using an attribute called &#8220;notify&#8221; and there&#8217;s already an internal method with that name, so I was overriding it and breaking everything. I&#8217;ve seen many people with the same problem, so here&#8217;s a little help. <a href="http://github.com/lucashungaro/reserved_attributes/tree/master" target="_blank">Take a look at the repository main page</a> to see the README file with instructions.</p>
<p>The plugin is hosted at <a href="http://www.github.com" target="_blank">github</a> and you&#8217;re free to fork and improve it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemesimple.com/blog/2008/04/07/contributing-reserved_attributes-rails-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

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