<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'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> desc "Run all fast specs in spec directory (excluding plugin specs)"</div>
<div> Spec::Rake::SpecTask.new(:fast) do |t|</div><div> t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]</div><div> t.spec_files = FileList['spec/**/*_fast_spec.rb']</div>
<div> #t.ruby_opts = ['-r spec/spec_helper', '-rubygems', '-runit_record', "-e 'ActiveRecord::Base.disconnect!'"]</div><div> end</div><div><br></div><div> desc "Run all non-fast specs in spec directory (excluding plugin specs)"</div>
<div> Spec::Rake::SpecTask.new(:slow => spec_prereq) do |t|</div><div> t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]</div><div> t.spec_files = FileList['spec/**/*_spec.rb'].exclude('spec/**/*_fast_spec.rb')</div>
<div> 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 <<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>> 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'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't know where I got that in my head, but it seems I did.<br>
<br>
I don't recall who said it, but unit_record does the column caching I thought rails did. So now it'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