<div>Here are some Rake tasks I created to use RSpec with UnitRecord. I set the default task to first run spec:fast, then spec:slow, so if the fast ones fail we don&#39;t have to wait on the slow ones to set up and run.</div>
<div><br></div><div>The fly in the ointment is that schema.rb has to be current.</div><div><br></div><div>namespace :spec do</div><div><br></div><div>&nbsp;&nbsp;desc &quot;Run all fast specs in spec directory (excluding plugin specs)&quot;</div>
<div>&nbsp;&nbsp;Spec::Rake::SpecTask.new(:fast) do |t|</div><div>&nbsp;&nbsp; &nbsp;t.spec_opts = [&#39;--options&#39;, &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;]</div><div>&nbsp;&nbsp; &nbsp;t.spec_files = FileList[&#39;spec/**/*_fast_spec.rb&#39;]</div>
<div>&nbsp;&nbsp; &nbsp;#t.ruby_opts = [&#39;-r spec/spec_helper&#39;, &#39;-rubygems&#39;, &#39;-runit_record&#39;, &quot;-e &#39;ActiveRecord::Base.disconnect!&#39;&quot;]</div><div>&nbsp;&nbsp;end</div><div><br></div><div>&nbsp;&nbsp;desc &quot;Run all non-fast specs in spec directory (excluding plugin specs)&quot;</div>
<div>&nbsp;&nbsp;Spec::Rake::SpecTask.new(:slow =&gt; spec_prereq) do |t|</div><div>&nbsp;&nbsp; &nbsp;t.spec_opts = [&#39;--options&#39;, &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;]</div><div>&nbsp;&nbsp; &nbsp;t.spec_files = FileList[&#39;spec/**/*_spec.rb&#39;].exclude(&#39;spec/**/*_fast_spec.rb&#39;)</div>
<div>&nbsp;&nbsp;end</div><div><br></div><div>end</div><div><br></div><br><div class="gmail_quote">On Wed, Jun 11, 2008 at 1:36 AM, David Chelimsky &lt;<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On Jun 9, 2008, at 11:31 PM, David Chelimsky wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey Chirb,<div class="Ih2E3d"><br>
<br>
Lastly, I may have mis-spoke about rails loading up columns from schema.rb - I&#39;m looking into it and will follow up when I learn the truth. So Ryan - keep using unit-record for now :)<br>
</div></blockquote>
<br>
I definitely mis-spoke. I don&#39;t know where I got that in my head, but it seems I did.<br>
<br>
I don&#39;t recall who said it, but unit_record does the column caching I thought rails did. So now it&#39;s off to figure out how to get rspec to play nice w/ unit_record.<br>
<br>
More soon.<div><div></div><div class="Wj3C7c"><br>
<br>
Cheers,<br>
David<br>
_______________________________________________<br>
<a href="mailto:ChicagoGroup-Members-List@rubyforge.org" target="_blank">ChicagoGroup-Members-List@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/chicagogroup-members-list" target="_blank">http://rubyforge.org/mailman/listinfo/chicagogroup-members-list</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Ryan Platte