<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>David Chelimsky: RSpec-0.9.1 and Autotest (ZenTest-3.5.2)</title>
    <link>http://blog.davidchelimsky.net/articles/2007/05/01/rspec-0-9-1-and-autotest-zentest-3-5-2</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>on software in process and practice</description>
    <item>
      <title>RSpec-0.9.1 and Autotest (ZenTest-3.5.2)</title>
      <description>&lt;p&gt;&lt;a href="http://zentest.rubyforge.org/ZenTest/classes/Autotest.html"&gt;Autotest&lt;/a&gt; (part of &lt;a href="http://zentest.rubyforge.org"&gt;ZenTest&lt;/a&gt;) now supports &lt;a href="http://rspec.rubyforge.org"&gt;RSpec&lt;/a&gt;. This is fantastic news! For those of you who do not know about autotest, it is a program that runs in the background while you are writing your tests and code. Each time you make a change it automatically reruns your tests &amp;#8211; and now your specs, too! This is a powerful addition to the &lt;span class="caps"&gt;TDD&lt;/span&gt;/BDD experience.&lt;/p&gt;


	&lt;p&gt;Recent releases of both tools overlapped a bit so there are changes in &lt;a href="http://rubyforge.org/frs/shownotes.php?release_id=11423"&gt;RSpec-0.9.1&lt;/a&gt; that are not reflected yet in ZenTest. Also, while ZenTest-3.5.2 supports &lt;a href="http://rspec.rubyforge.org/documentation/rails/index.html"&gt;Spec::Rails&lt;/a&gt;, RSpec&amp;#8217;s &lt;a href="http://rubyonrails.com"&gt;Ruby on Rails&lt;/a&gt; plugin, it does not support non-Rails Ruby projects.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve submitted a patch to the ZenTest project which addresses both of these issues. Until the patch is applied, or the issues are addressed in some other way, you can apply it yourself to get autotest working with RSpec for Rails and other projects. These steps work on a mac. I assume that the commands are quite similar for Linux and Cygwin users.&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;Go to http://rubyforge.org/frs/?group_id=419 and download ZenTest-3.5.2.tgz&lt;/li&gt;
&lt;li&gt;Unpack the tar and 
&lt;pre&gt;tar zxvf ZenTest-3.5.2.tgz
cd ZenTest-3.5.2
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Get and install the patch
&lt;pre&gt;curl -O http://blog.davidchelimsky.net/files/ZenTest-3.5.2-rspec.patch
patch -p0 &amp;lt; ZenTest-3.5.2-rspec.patch
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Build and install the gem
&lt;pre&gt;rake gem
sudo gem install pkg/ZenTest-3.5.2.gem
&lt;/pre&gt;
&lt;/ol&gt;

	&lt;p&gt;Once you&amp;#8217;ve built and installed the patched gem, you run autotest as normal. Stand in the root of your project and say:&lt;/p&gt;


&lt;pre&gt;autotest&lt;/pre&gt;

	&lt;p&gt;If you have a &lt;code&gt;spec&lt;/code&gt; directory at the root of your project, autotest will load up rspec_rails_autotest for Rails projects and rspec_autotest for everything else.&lt;/p&gt;


	&lt;p&gt;To quote &lt;a href="http://joshknowles.com/2007/4/13/zentest-3-5-rspec-0-9-autospec"&gt;Josh Knowles&lt;/a&gt;, Happy (Auto)Specing!&lt;/p&gt;</description>
      <pubDate>Tue, 01 May 2007 08:27:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:81ac858d-b9ec-4f5f-ae2a-9c30a13e2ee8</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2007/05/01/rspec-0-9-1-and-autotest-zentest-3-5-2</link>
      <category>rspec</category>
      <category>ruby</category>
      <category>autotest</category>
      <category>bdd</category>
      <enclosure type="text/x-patch" url="http://blog.davidchelimsky.net/files/ZenTest-3.5.2-rspec.patch" length="7548"/>
      <trackback:ping>http://blog.davidchelimsky.net/articles/trackback/235</trackback:ping>
    </item>
    <item>
      <title>"RSpec-0.9.1 and Autotest (ZenTest-3.5.2)" by David James</title>
      <description>&lt;p&gt;I&amp;#8217;m running ZenTest (3.5.2) and I&amp;#8217;m using rspec 0.9.5.  I got an error when running autotest; here is the log:&lt;/p&gt;


&lt;pre&gt;
$autotest
loading rspec_rails_autotest
spec --diff unified spec/models/spec/models/person_spec.rb ...
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27: command not found:  spec --diff unified spec/models/person_spec.rb
&lt;/pre&gt;

	&lt;p&gt;I guessed the fix pretty quickly.  To run spec, I have to do `rake spec` or `script/spec`.  Not just `spec`.  So here is how I fixed the problem:&lt;/p&gt;


In my rspec_rails_autotest.rb, I noticed this line:
&lt;pre&gt;
@spec_command = "spec --diff unified" 
&lt;/pre&gt;

Changing it to this solved my problem:
&lt;pre&gt;
@spec_command = "script/spec --diff unified" 
&lt;/pre&gt;

Then, as mentioned in other places, I needed to install diff-lcs as well:
&lt;pre&gt;sudo gem install diff-lcs&lt;/pre&gt;

	&lt;p&gt;Are others having the same problem?  Did my fix work for you?&lt;/p&gt;</description>
      <pubDate>Sat, 12 May 2007 14:25:31 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:e22de852-aa34-406d-aa07-fcdb794d4b73</guid>
      <link>http://blog.davidchelimsky.net/articles/2007/05/01/rspec-0-9-1-and-autotest-zentest-3-5-2#comment-245</link>
    </item>
    <item>
      <title>"RSpec-0.9.1 and Autotest (ZenTest-3.5.2)" by David James</title>
      <description>&lt;p&gt;I&amp;#8217;m running ZenTest (3.5.2) and I&amp;#8217;m using rspec 0.9.5.  I got an error when running autotest; here is the log:&lt;/p&gt;


&lt;pre&gt;
$autotest
loading rspec_rails_autotest
spec --diff unified spec/models/spec/models/person_spec.rb ...
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27: command not found:  spec --diff unified spec/models/person_spec.rb
&lt;/pre&gt;

	&lt;p&gt;I guessed the fix pretty quickly.  To run spec, I have to do `rake spec` or `script/spec`.  Not just `spec`.  So here is how I fixed the problem:&lt;/p&gt;


In my rspec_rails_autotest.rb, I noticed this line:
&lt;pre&gt;
@spec_command = "spec --diff unified" 
&lt;/pre&gt;

Changing it to this solved my problem:
&lt;pre&gt;
@spec_command = "script/spec --diff unified" 
&lt;/pre&gt;

Then, as mentioned in other places, I needed to install diff-lcs as well:
&lt;pre&gt;sudo gem install diff-lcs&lt;/pre&gt;

	&lt;p&gt;Are others having the same problem?  Did my fix work for you?&lt;/p&gt;</description>
      <pubDate>Sat, 12 May 2007 14:24:49 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:89c828fc-ba88-42c5-b8b6-c86b92924f59</guid>
      <link>http://blog.davidchelimsky.net/articles/2007/05/01/rspec-0-9-1-and-autotest-zentest-3-5-2#comment-244</link>
    </item>
    <item>
      <title>"RSpec-0.9.1 and Autotest (ZenTest-3.5.2)" by David</title>
      <description>&lt;p&gt;Hussein &amp;#8211; take a look at spec/spec.opts and get rid of everything related to&amp;#8212;failures and&amp;#8212;example. That should do the trick for the continuous run problem.&lt;/p&gt;


	&lt;p&gt;The coloring there is no solution for at the moment (that I am aware of).&lt;/p&gt;</description>
      <pubDate>Sun, 06 May 2007 23:52:14 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:068a6b1a-f026-4954-8bcc-7851b734344b</guid>
      <link>http://blog.davidchelimsky.net/articles/2007/05/01/rspec-0-9-1-and-autotest-zentest-3-5-2#comment-243</link>
    </item>
    <item>
      <title>"RSpec-0.9.1 and Autotest (ZenTest-3.5.2)" by Hussein Morsy</title>
      <description>&lt;p&gt;Thanks !&lt;/p&gt;


	&lt;p&gt;but i have two problem/questions:
1.  If a example fails, autotest repeats the the execution of the failed  example continiously.( although i didn&amp;#8217;t change any file)&lt;/p&gt;


	&lt;p&gt;2. How to enable synstax coloring ?&lt;/p&gt;</description>
      <pubDate>Thu, 03 May 2007 04:45:31 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:46c0ce5d-46e8-46f3-870b-6ea3f9b24e0b</guid>
      <link>http://blog.davidchelimsky.net/articles/2007/05/01/rspec-0-9-1-and-autotest-zentest-3-5-2#comment-242</link>
    </item>
    <item>
      <title>"RSpec-0.9.1 and Autotest (ZenTest-3.5.2)" by Matt Aimonetti</title>
      <description>&lt;p&gt;Thanks!&lt;/p&gt;</description>
      <pubDate>Tue, 01 May 2007 23:33:19 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:16860dab-ab70-40e7-915f-dfb86658a94f</guid>
      <link>http://blog.davidchelimsky.net/articles/2007/05/01/rspec-0-9-1-and-autotest-zentest-3-5-2#comment-240</link>
    </item>
    <item>
      <title>"RSpec-0.9.1 and Autotest (ZenTest-3.5.2)" by Josh Knowles</title>
      <description>&lt;p&gt;Nice work, thanks!&lt;/p&gt;</description>
      <pubDate>Tue, 01 May 2007 12:21:59 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:20132079-92f3-4be6-abc3-75df6b89e8a5</guid>
      <link>http://blog.davidchelimsky.net/articles/2007/05/01/rspec-0-9-1-and-autotest-zentest-3-5-2#comment-238</link>
    </item>
  </channel>
</rss>
