Nick Sieger: Auto RSpec http://blog.nicksieger.com/articles/2006/09/13/auto-rspec en-us 40 "Auto RSpec" by Nick <p>Ah, the issue looks like the change of the <code>--diff</code> argument to spec. Can you try the most recent code in svn and let me know if it works for you? Post updated with new links to <a href='http://svn.caldersphere.net/svn/main/rspec_autotest/trunk' rel="nofollow">http://svn.caldersphere.net/svn/main/rspec_autotest/trunk</a></p> Tue, 14 Nov 2006 17:28:38 +0000 urn:uuid:4774f059-a232-402b-9c6b-42e642faa79c http://blog.nicksieger.com/articles/2006/09/13/auto-rspec#comment-149 "Auto RSpec" by Nick <p>Can one of you guys file a report of some sort at <a href='http://trac.caldersphere.net/projects/main/newticket' rel="nofollow">http://trac.caldersphere.net/projects/main/newticket</a> ?</p> <p>Thanks!</p> Tue, 14 Nov 2006 16:10:04 +0000 urn:uuid:b5a1d46f-de76-4f22-837a-731c8b4d2e03 http://blog.nicksieger.com/articles/2006/09/13/auto-rspec#comment-148 "Auto RSpec" by Pius <p>This looks really sweet! I&#8217;m having the same issue as meekish though, using ZenTest 3.4.1 and RSpec 0.7.2.</p> Sun, 12 Nov 2006 23:33:15 +0000 urn:uuid:9706c938-5272-4c91-95a3-f3486ab44b91 http://blog.nicksieger.com/articles/2006/09/13/auto-rspec#comment-147 "Auto RSpec" by Nick <p>I haven&#8217;t seen that error before, could you provide the full command line that autotest is invoking? Also, which versions of RSpec and ZenTest?</p> Wed, 08 Nov 2006 16:38:31 +0000 urn:uuid:4badffa4-c182-4f8a-940d-11957742f9f4 http://blog.nicksieger.com/articles/2006/09/13/auto-rspec#comment-144 "Auto RSpec" by meekish <p>I&#8217;m getting this error when running rake spec:autotest </p> <p>Couldn&#8217;t find differ class spec/models/product_spec.rb Make sure the &#8211;require option is specified <em>before</em> &#8211;diff</p> <p>Do you know what would cause it?</p> Wed, 08 Nov 2006 07:53:03 +0000 urn:uuid:ced881dd-3137-4915-afca-50b798308f88 http://blog.nicksieger.com/articles/2006/09/13/auto-rspec#comment-143 "Auto RSpec" by Nick <p>Please do, I was hoping you&#8217;d take notice and make autotest more extensible as a result. I realize now that I put it out there w/o a copyright notice, so I&#8217;ll relinquish it to you as long as you give me an attribution for it. Thanks!</p> Fri, 15 Sep 2006 14:25:11 +0000 urn:uuid:63cbdf6b-41a2-40a2-90be-2bffbdaacf72 http://blog.nicksieger.com/articles/2006/09/13/auto-rspec#comment-62 "Auto RSpec" by zenspider <p>May I steal this?</p> Thu, 14 Sep 2006 21:00:03 +0000 urn:uuid:b195b3cd-de1b-43d4-a66d-99b78918f2f7 http://blog.nicksieger.com/articles/2006/09/13/auto-rspec#comment-61 "Auto RSpec" by Josh <p>Nice!</p> Thu, 14 Sep 2006 09:36:35 +0000 urn:uuid:dc51d895-2bed-4dcb-b71f-77114ab82fcc http://blog.nicksieger.com/articles/2006/09/13/auto-rspec#comment-60 Auto RSpec <p><em>Update: (2 months later) If you&#8217;re reading this, you&#8217;re probably interested in <a href="/articles/2006/11/15/rspec-autotest-now-a-rails-plugin">my Rails plugin for this</a> instead.</em></p> <p>Hot off the presses, after a few hours of hacking and tweaking, may I present Auto+RSpec, otherwise known as The Mashup of <a href="http://rspec.rubyforge.org/tools/rails.html">RSpec on Rails</a> and <a href="http://www.zenspider.com/ZSS/Products/ZenTest/">autotest</a>. This is not an official release of any sort, but &#8220;may work for you.&#8221; It&#8217;s not a clean hack, as it exposes some areas for autotest to grow if the maintainers decide to open it up to alternatives to Test::Unit. After spending a little time looking at the autotest code, I think it would be nice to allow hooks for autotest plugins to define project conventions (i.e., <code>@exceptions</code> and the <code>#tests_for_file</code> method) as well as a result parsing API.</p> <p>For now, if you&#8217;re an RSpec on Rails user, you can try this out as follows:</p> <ul> <li>Install <a href="http://www.zenspider.com/ZSS/Products/ZenTest/">ZenTest</a> if you haven&#8217;t already: <code>sudo gem install ZenTest</code>.</li> <li>Download <a href="http://svn.caldersphere.net/svn/main/rspec_autotest/trunk/lib/rspec_autotest.rb">rspec_autotest.rb</a> and put in your <code>vendor/plugins/rspec/lib</code> directory (you did say you&#8217;re using RSpec on Rails didn&#8217;t you?)</li> <li>Download <a href="http://svn.caldersphere.net/svn/main/rspec_autotest/trunk/tasks/rspec_autotest.rake">rspec_autotest.rake</a> and put in your <code>lib/tasks</code> directory</li> <li>Start <code>autotest</code> with rake by typing <code>rake spec:autotest</code></li> <li>Note: if you&#8217;re using RSpec 0.6, you might have better success with <a href="http://svn.caldersphere.net/svn/main/rspec_autotest/tags/rspec-0.6.0">the files located here</a>.</li> </ul> <p>Next steps for this will be to work out whether this code should live in RSpec on Rails or autotest, or some combination of those.</p> <p>Now, spec&#8217;ers, be off in search of that <strong>Red/Green/Refactor</strong> rhythm of which sage agilists speak!</p> <p><strong>Bonus tip</strong>: add the following code to your <code>.autotest</code> file to run <code>spec</code> with <code>rcov</code>:</p> <div class="typocode"><pre><code class="typocode_ruby "> <span class="constant">Autotest</span><span class="punct">.</span><span class="ident">add_hook</span> <span class="symbol">:initialize</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">at</span><span class="punct">|</span> <span class="comment"># run spec with rcov</span> <span class="keyword">if</span> <span class="ident">at</span><span class="punct">.</span><span class="ident">respond_to?</span> <span class="symbol">:spec_command</span> <span class="ident">at</span><span class="punct">.</span><span class="ident">spec_command</span> <span class="punct">=</span> <span class="punct">%{</span><span class="string">rcov --exclude &quot;lib/spec/.*&quot; -Ilib --rails &quot;/usr/lib/ruby/gems/1.8/gems/rspec-0.6.0/bin/spec&quot; -- --diff</span><span class="punct">}</span> <span class="keyword">end</span> <span class="keyword">end</span></code></pre></div> Wed, 13 Sep 2006 20:35:00 +0000 urn:uuid:52bf2e58-ea0e-4473-bad5-c7b42775bfee Nick Sieger http://blog.nicksieger.com/articles/2006/09/13/auto-rspec testing ruby rails ruby autotest rspec testing http://blog.nicksieger.com/articles/trackback/59