Nick Sieger: RSpec Autotest for Standalone Projectstag:blog.nicksieger.com,2005:TypoTypo2007-08-31T18:55:10+00:00Victorurn:uuid:5f5834cb-fff8-408a-86f7-bed53dc858892007-01-30T16:45:52+00:002007-08-31T18:55:10+00:00Comment on RSpec Autotest for Standalone Projects by Victor<p>Love it! Thanks, Nick.</p>
<p>One feature request: It would be nice to have a task to run it against the spec server which is much faster.</p>
<p>Something like:</p>
<pre>
namespace :spec do
task :autotest do
require_rspec_autotest
RspecOnRailsAutotest.run
end
task :autotest_drb do
require_rspec_autotest
autotest = RspecOnRailsAutotest.new
autotest.spec_command = "drbspec --diff unified"
autotest.run
end
private
def require_rspec_autotest
require File.join(File.dirname(__FILE__), '..', 'lib', 'rspec_autotest')
end
end
</pre>Nick Siegerurn:uuid:ea568e8e-e6f4-4fb7-80df-8da5f50065b92007-01-30T02:16:00+00:002007-08-31T18:00:07+00:00RSpec Autotest for Standalone Projects<p>I know there has been some demand out there for a version of my <a href="/articles/2006/11/15/rspec-autotest-now-a-rails-plugin">RSpec Autotest Rails plugin</a> that works with standalone (non-Rails) projects, so I finally caved and coded it up. I really hope this does finally get accepted as <a href="https://rubyforge.org/tracker/?func=detail&aid=6732&group_id=419&atid=1680">a patch to ZenTest</a> (nudge, nudge), but until it gets a more standard release, do try it out:</p>
<ol>
<li>Ensure you have ZenTest installed (<code>gem install ZenTest</code>).</li>
<li><a href="http://svn.caldersphere.net/svn/main/rspec_autotest/trunk/lib/rspec_autotest.rb">Download the rspec_autotest.rb file here</a> and put it in the <code>spec</code> directory of your project.</li>
<li>Add this snippet of code into your <code>Rakefile</code>, and <code>rake spec:autotest</code> as usual.</li>
</ol>
<div class="typocode"><pre><code class="typocode_ruby "><span class="ident">namespace</span> <span class="symbol">:spec</span> <span class="keyword">do</span>
<span class="ident">task</span> <span class="symbol">:autotest</span> <span class="keyword">do</span>
<span class="ident">require</span> <span class="punct">'</span><span class="string">./spec/rspec_autotest</span><span class="punct">'</span>
<span class="constant">RspecAutotest</span><span class="punct">.</span><span class="ident">run</span>
<span class="keyword">end</span>
<span class="keyword">end</span></code></pre></div>
<p>Once again, happy spec’ing, and let me know of any issues you have with it.</p>