At work we&#39;ve got a rather complex app with both specs and tests. Our default rake task runs all our our tests and specs.&nbsp; We&#39;ve also got separate rake tasks to run groups of tests and specs in the various subdirectories.&nbsp; The default task simply lists all the individual tasks as pre-reqs.<br>
<br>We do a lot of branching and merging, so we really want to run all of the tests and specs to see all failures.<br><br>We just realized that Rspec is aborting rake when a spec fails or errors in an individual rake task.&nbsp; I&#39;ve been trying to fix this to no avail.&nbsp; I notice that SpecTask has an attribute accessor fail_on_error which looks like it SHOULD prevent terminating rake if it&#39;s set to false.&nbsp; So I tried that and it doesn&#39;t seem to work.&nbsp; Here&#39;s our projects lib/tasks/spec.rake, any ideas?<br>
<br><br>def spec_tasks<br>&nbsp; %w{spec:controllers spec:models spec:helpers spec:views spec:lib} + spec_subdirs.map {|t| &quot;spec:#{t}&quot;}<br>end<br><br>begin<br>&nbsp; require RAILS_ROOT + &#39;/vendor/plugins/rspec/lib/spec/rake/spectask&#39;<br>
<br>&nbsp; namespace :spec do<br>&nbsp;&nbsp; spec_subdirs.each do |task|<br>&nbsp;&nbsp;&nbsp;&nbsp; next if Rake::Task.task_defined?(&quot;spec:#{task}&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; desc &quot;Run the specs under spec/#{task}&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp; Spec::Rake::SpecTask.new(task) do |t|<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.fail_on_error = false<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.spec_opts = [&#39;--options&#39;, &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.spec_files = FileList[&quot;spec/#{task}/*_spec.rb&quot;]<br>&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp; namespace(task) do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Spec::Rake::SpecTask.new(:rcov) do |t|<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.fail_on_error = false<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.spec_opts = [&#39;--options&#39;, &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.rcov_opts = [&#39;--include&#39;, &quot;\&quot;app/#{task}/.*.rb$\&quot;&quot;]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.rcov = true<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.spec_files = FileList[&quot;spec/#{task}/*_spec.rb&quot;]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp; end<br>&nbsp; end<br>rescue LoadError =&gt; e<br>&nbsp; puts &quot;Spec tasks are not available - #{e}&quot;<br>
end<br><br>namespace :spec do<br>&nbsp; desc &quot;Run each set of specs individually&quot;<br>&nbsp; task :each =&gt; spec_tasks<br>end<br><br clear="all"><br>-- <br>Rick DeNatale<br><br>My blog on Ruby<br><a href="http://talklikeaduck.denhaven2.com/">http://talklikeaduck.denhaven2.com/</a>