<?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>Rails on the Run &#187; integration</title>
	<atom:link href="http://railsontherun.com/tag/integration/feed/" rel="self" type="application/rss+xml" />
	<link>http://railsontherun.com</link>
	<description>Rails experiments by Matt Aimonetti</description>
	<lastBuildDate>Tue, 23 Feb 2010 07:28:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Misc tips and tricks</title>
		<link>http://railsontherun.com/2008/01/30/misc-tips-and-tricks/</link>
		<comments>http://railsontherun.com/2008/01/30/misc-tips-and-tricks/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 08:00:00 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[autotest]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[RSpec]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[zentest]]></category>

		<guid isPermaLink="false">http://railsontherun.com/2008/01/30/misc-tips-and-tricks</guid>
		<description><![CDATA[I haven&#8217;t posted for quite a long time. The thing is I moved to a new place and I&#8217;m really busy on working clients + setting up my new office + dealing with way too much paperwork. 
Anyway, enough excuses, here are few tips that I believe will be useful to some of you:
ZenTest Autotest
I [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t posted for quite a long time. The thing is I moved to a new place and I&#8217;m really busy on working clients + setting up my new office + dealing with way too much paperwork. </p>
<p>Anyway, enough excuses, here are few tips that I believe will be useful to some of you:</p>
<h2><a href="http://www.zenspider.com/ZSS/Products/ZenTest/">ZenTest Autotest</a></h2>
<p>I love autotest, but you might have noticed that sometimes (especially on big projects), ZenTest might start using more CPU than expected. On my machine, that results in the fan going off and annoying the crap out of me.</p>
<p>The solution is quite simple, exclude all folders you don&#8217;t need to monitor. To do that, update ZenTest to version 3.8.X </p>
<pre><code>sudo gem update ZenTest
</code></pre>
<p>(older version had a different syntax)</p>
<p>Now, edit your .autotest that should be located in ~/.autotest  (if it doesn&#8217;t exist, create it).</p>
<p>Finally add the following code:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><tt>
</tt>  <span class="co">Autotest</span>.add_hook <span class="sy">:initialize</span> <span class="r">do</span> |at|<tt>
</tt>    <span class="s"><span class="dl">%w{</span><span class="k">.svn .hg .git vendor</span><span class="dl">}</span></span>.each {|exception| at.add_exception(exception)}<tt>
</tt>  <span class="r">end</span><tt>
</tt></pre>
</td>
</tr>
</table>
<p>I personally freeze rails in vendor and I autotest is way happier when it doesn&#8217;t have to monitor some extra files. (note that we also exclude folders such as .git or .svn)<br />
(you can also include files etc&#8230; read more <a href="http://blog.davidchelimsky.net/articles/2008/01/15/rspec-1-1-2-and-zentest-3-8-0">there</a>)</p>
<h2><a href="http://rspec.info">RSpec</a></h2>
<p>RSpec is certainly my favorite Ruby tool and I&#8217;m glad to say that most of my <a href="http://sdruby.com/">SD.rb</a> friends finally got convinced!</p>
<p>Now, few people complained to me about spec failures outputting the full stack such as:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt><strong>5</strong><tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt>9<tt>
</tt><strong>10</strong><tt>
</tt>11<tt>
</tt>12<tt>
</tt>13<tt>
</tt>14<tt>
</tt><strong>15</strong><tt>
</tt>16<tt>
</tt>17<tt>
</tt>18<tt>
</tt>19<tt>
</tt><strong>20</strong><tt>
</tt>21<tt>
</tt>22<tt>
</tt>23<tt>
</tt>24<tt>
</tt><strong>25</strong><tt>
</tt>26<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><tt>
</tt> <span class="co">The</span> <span class="co">Sessions</span> controller should fail since it<span class="s"><span class="dl">'</span><span class="k">s a test</span><span class="dl">'</span></span> <span class="co">FAILED</span><tt>
</tt> expected <span class="pc">true</span>, got <span class="pc">false</span><tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/expectations.rb:<span class="i">52</span><span class="sy">:in</span> <span class="sh"><span class="dl">`</span><span class="k">fail_with'<tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/expectations/handler.rb:21:in </span><span class="dl">`</span></span>handle_matcher<span class="s"><span class="dl">'</span><span class="k"><tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/expectations/extensions/object.rb:34:in `should</span><span class="dl">'</span></span><tt>
</tt> ./spec/controllers/sessions_controller_spec.rb:<span class="i">25</span>:<tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/example/example_methods.rb:<span class="i">78</span><span class="sy">:in</span> <span class="sh"><span class="dl">`</span><span class="k">instance_eval'<tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/example/example_methods.rb:78:in </span><span class="dl">`</span></span>run_with_description_capturing<span class="s"><span class="dl">'</span><span class="k"><tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/example/example_methods.rb:19:in `execute</span><span class="dl">'</span></span><tt>
</tt> <span class="rx"><span class="dl">/</span><span class="k">opt</span><span class="dl">/</span></span>local/lib/ruby/<span class="fl">1.8</span>/timeout.rb:<span class="i">48</span><span class="sy">:in</span> <span class="sh"><span class="dl">`</span><span class="k">timeout'<tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/example/example_methods.rb:16:in </span><span class="dl">`</span></span>execute<span class="s"><span class="dl">'</span><span class="k"><tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:288:in `execute_examples</span><span class="dl">'</span></span><tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:<span class="i">287</span><span class="sy">:in</span> <span class="sh"><span class="dl">`</span><span class="k">each'<tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:287:in </span><span class="dl">`</span></span>execute_examples<span class="s"><span class="dl">'</span><span class="k"><tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:121:in `run</span><span class="dl">'</span></span><tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:<span class="i">22</span><span class="sy">:in</span> <span class="sh"><span class="dl">`</span><span class="k">run'<tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:21:in </span><span class="dl">`</span></span>each<span class="s"><span class="dl">'</span><span class="k"><tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:21:in `run</span><span class="dl">'</span></span><tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/runner/options.rb:<span class="i">89</span><span class="sy">:in</span> <span class="sh"><span class="dl">`</span><span class="k">run_examples'<tt>
</tt> test_app-git/trunk/vendor/plugins/rspec/lib/spec/runner/command_line.rb:19:in </span><span class="dl">`</span></span>run<span class="s"><span class="dl">'</span><span class="k"><tt>
</tt> script/spec:4:<tt>
</tt><tt>
</tt>  Finished in 6.035147 seconds<tt>
</tt><tt>
</tt>  400 examples, 1 failure<tt>
</tt></span></span></pre>
</td>
</tr>
</table>
<p>We can really easily change that, open you spec.opts file located in your spec folder.</p>
<p>it probably looks like that:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt><strong>5</strong><tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><tt>
</tt>  --colour<tt>
</tt>  --format<tt>
</tt>  progress<tt>
</tt>  --loadby<tt>
</tt>  mtime<tt>
</tt>  --reverse<tt>
</tt>  --backtrace<tt>
</tt></pre>
</td>
</tr>
</table>
<p>Get rid of &#8220;&#8211;backtrace&#8221; and your new failure should look like:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt><strong>5</strong><tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt>9<tt>
</tt><strong>10</strong><tt>
</tt>11<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><tt>
</tt>  <span class="i">1</span>)<tt>
</tt>  <span class="s"><span class="dl">'</span><span class="k">The Sessions controller The Sessions controller should fail since it</span><span class="dl">'</span></span>s a test<span class="s"><span class="dl">'</span><span class="k"> FAILED<tt>
</tt>  expected false, got true<tt>
</tt>  ./spec/controllers/sessions_controller_spec.rb:25:<tt>
</tt>  script/spec:4:<tt>
</tt><tt>
</tt>  Finished in 0.269956 seconds<tt>
</tt><tt>
</tt>  15 examples, 1 failure<tt>
</tt>  <tt>
</tt></span></span></pre>
</td>
</tr>
</table>
<h2>Other stuff you may find interesting (in no particular order):</h2>
<ul>
<li><a href="http://opensource.thinkrelevance.com/wiki/spec-converter">spec converter</a></li>
<li><a href="http://cells.rubyforge.org/overview.html">Rails Cell</a></li>
<li><a href="http://jointheconversation.org/railsgit">Git to manage and deploy a Rails app</a></li>
<li><a href="http://rufy.com/contacts/doc/">contacts (retrieve user&#8217;s contacts from yahoo, gmail etc..)</a></li>
<li><a href="http://www.hashrocket.com/">Hashrocket</a></li>
<li><a href="http://www.amazon.com/Rails-Way-Addison-Wesley-Professional-Ruby/dp/0321445619">one of the best Rails book of the moment</a></li>
<li><a href="http://famspam.com/">err&#8217;s new baby</a> </li>
<li><a href="http://blog.caboo.se/articles/2008/1/30/caboose-conf-2008">caboose conf 08</a></li>
<li><a href="http://github.com/">git hub</a></li>
<li><a href="http://swxruby.org/">SWX Ruby (or how to get Rails to talk with Flash even faster)</a></li>
<li><a href="http://ruby.reddit.com">Ruby Reddit</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://railsontherun.com/2008/01/30/misc-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

