<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -66,12 +66,12 @@ task drops your tables and starts over by dropping the tables directly and then
 re-running your migrations. This provides a great way to test to make sure you
 haven't broken migrations at some point, which *will* happen to you at some point.
 
-=== rake db:to_yaml (formerly rake:db:import)
+=== rake db:to_yaml
 
 Dump your database to fixtures. Stores them in RAILS_ROOT/production_data. You can then use this to load the data back into another database, even one of a different type. We've used this to move
 data from SQL Server to MySQL and back again.
 
-=== rake db:from_yaml (formerly rake:db:export)
+=== rake db:from_yaml
 Load fixtures from RAILS_ROOT/production_data into your database. Loads fixtures dumped by using rake db:export
 
 == Subversion
@@ -89,23 +89,56 @@ Displays the last tag.
 Creates a new tag from the trunk.
 
 == Rcov
-Thanks to Kevin Gisi for these tasks that make running RCov a bit easier.
-Requires the RCov gem and the rails_rcov plugin
+We're fans of RCov and we've included some ways to make it easier to use RCov in your projects.
 
-=== rake rcov:models
+=== Test::Unit
+
+In order to use the Test::Unit coverage tasks, you'll need to install the Rails_rcov plugin
+
+  ruby script/plugin install http://svn.codahale.com/rails_rcov/
+
+This is not needed if your project uses Rspec.
+
+==== rake test:models:rcov
 
 Runs coverage on your models
 
-=== rake rcov:controllers
+=== rake test:controllers:rcov
 
 Runs coverage on your controllers
 
-=== rake rcov:full
+==== rake test:rcov:full
 
 Runs coverage on models and controllers
 
+=== RSpec
+
+Rspec already includes the ability to get code coverage, but we made it just as focused and granular as we made the tasks for Test::Unit
+
+==== rake spec:models:rcov
+
+Coverage for models
+
+==== rake spec:controllers:rcov
+
+Coverage for controllers
+
+==== rake spec:views:rcov
+
+Coverage for views
+
+==== rake spec:helpers:rcov
+
+Coverage for helpers
+
+==== rake spec:lib:rcov
+
+Coverage for files in lib/
+
+== Test::Unit
+
+=== Running individual tests
 
-== Tests
 Based on an idea from Geoffrey Grosenbach, you can run all tests in units\user_test.rb by doing
 
   rake test:units:user:all
@@ -119,19 +152,19 @@ The same rules apply to functional tests
 
   rake test:functionals:users:list
 
-== Specs
+== RSpec
 
 RSpec gets some love here. If you need nice output for your specs, we overrode 
 some of the built-in specs.
 
-=== Running all model specs
+=== rake spec:models
 
-  rake spec:models
-  
-=== Running all controller specs
+Runs all model specs
 
-  rake spec:controllers
+=== rake spec:controllers
   
+Runs all controller specs
+
 === Running a specific model or controller spec
 
   rake spec:model:user</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-VERSION=&quot;1.1.5&quot;
+VERSION=&quot;1.1.7&quot;
 
 
 </diff>
      <filename>tasks/lazy_developer_tasks.rake</filename>
    </modified>
    <modified>
      <diff>@@ -1,62 +1,133 @@
+namespace :spec do
+  require 'spec/rake/spectask'
+  spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? &quot;db:test:prepare&quot; : :noop
+  
+  
+  [:models, :controllers, :views, :helpers, :lib].each do |sub|
+    namespace sub do
+      desc &quot;RCov for #{sub}&quot;
+      Spec::Rake::SpecTask.new(&quot;rcov&quot; =&gt; spec_prereq) do |t|
+        t.spec_opts = ['--options', &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;]
+        t.spec_files = FileList[&quot;spec/#{sub}/**/*_spec.rb&quot;]
+        t.rcov = true
+        
+        t.rcov_opts = lambda do
+          reg_exp = []
+          reg_exp &lt;&lt; case sub.to_s
+                      when 'models'
+                         'app\/models'
+                      when 'views'
+                         'app\/views'
+                      when 'controllers'
+                         'app\/controllers'
+                      when 'helpers'
+                         'app\/helpers'
+                      when 'lib' 
+                        'lib'
+                     end
+          reg_exp.map!{ |m| &quot;(#{m})&quot; }
+          rcov_opts = &quot; -x \&quot;^(?!#{reg_exp.join('|')})\&quot;&quot;
+          rcov_opts.map {|l| l.chomp.split &quot; &quot;}.flatten
+        end
+     
+      end
+    end
+  end
+end
+
+namespace :test do
+
+  namespace :models do
+    desc &quot;Run unit tests, and determine coverage on models.&quot;
+    task :rcov do
+      ENV[&quot;SHOW_ONLY&quot;] = &quot;m&quot;
+      Rake::Task['test:units:rcov'].invoke
+    end
+  end
+  
+  namespace :controllers do
+    desc &quot;Run functional tests, and determine coverage on controllers.&quot;
+    task :rcov do
+      ENV[&quot;SHOW_ONLY&quot;] = &quot;c&quot;
+      Rake::Task['test:functionals:rcov'].invoke
+    end
+  end
+  
+  namespace :rcov do
+    
+    # Runs all unit and functional tests, and determines
+    # coverage on models and controllers respectively.
+    desc &quot;Run functional and unit tests, and get coverage for both.&quot;
+    task :full do
+      Rake::Task['rcov:models'].invoke
+      Rake::Task['rcov:controllers'].invoke
+    end
+    
+    
+    
+    # Runs all unit and functional tests, and determines
+    # coverage on models and controllers respectively, ignoring errors.
+    desc &quot;Run functional and unit tests, and get coverage for both, ignoring errors.&quot;
+    task :report do
+      begin
+        Rake::Task['test:models:rcov'].invoke
+      ensure
+        begin
+          Rake::Task['test:controllers:rcov'].invoke
+        ensure
+          units = File.open(&quot;#{Dir.pwd}/coverage/units/index.html&quot;,&quot;r&quot;).read
+          units = units[units.index(&quot;coverage_code&quot;)+15,10]
+          units = units[0,units.index(&quot;&lt;&quot;)]
+          functionals = File.open(&quot;#{Dir.pwd}/coverage/functionals/index.html&quot;,&quot;r&quot;).read
+          functionals = functionals[functionals.index(&quot;coverage_code&quot;)+15,10]
+          functionals = functionals[0,functionals.index(&quot;&lt;&quot;)]
+          puts &quot;+-----------------------------+&quot;
+          puts &quot;| UNIT COVERAGE:       #{units.ljust(6)} |&quot;
+          puts &quot;| FUNCTIONAL COVERAGE: #{functionals.ljust(6)} |&quot;
+          puts &quot;+-----------------------------+&quot;
+          to_write = &quot;&lt;html&gt;&lt;body&gt;&lt;h1&gt;Rcov Report&lt;/h1&gt;
+          &lt;div style=\&quot;width:100%; height:50px; border: 1px solid black\&quot;&gt;&lt;div style=\&quot;height: 50px; width: #{units}%; background-color: #33FF00; font-size: 18pt; font-style: bold\&quot;&gt;&lt;a href=\&quot;units/index.html\&quot;&gt;Unit: #{units}&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
+          &lt;div style=\&quot;width:100%; height:50px; border: 1px solid black\&quot;&gt;&lt;div style=\&quot;height: 50px; width: #{functionals}%; background-color: #33FF00; font-size: 18pt; font-style: bold\&quot;&gt;&lt;a href=\&quot;functionals/index.html\&quot;&gt;Functional: #{functionals}&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
+          &lt;/body&gt;&lt;/html&gt;&quot;
+          File.open(&quot;coverage/report.html&quot;, &quot;w&quot;) do |f|
+        		f.puts to_write
+        	end
+      	
+        	if PLATFORM['darwin']
+            system(&quot;open #{pwd}/coverage/report.html&quot;)
+          end
+        end
+      end
+    end
+  end
+  
+end
+
+
 namespace :rcov do
     
   # Runs all unit tests, and determines coverage
   # only on the model level.
   desc &quot;Run unit tests, and determine coverage on models.&quot;
   task :models do
-    ENV[&quot;SHOW_ONLY&quot;] = &quot;m&quot;
-    Rake::Task['test:units:rcov'].invoke
+    Rake::Task['test:models:rcov'].invoke
   end
     
   # Runs all functional tests, and determines coverage
   # only on the controller level.
   desc &quot;Run functional tests, and determine coverage on controllers.&quot;
   task :controllers do
-    ENV[&quot;SHOW_ONLY&quot;] = &quot;c&quot;
-    Rake::Task['test:functionals:rcov'].invoke
+    Rake::Task['test:controllers:rcov'].invoke
   end
   
-  # Runs all unit and functional tests, and determines
-  # coverage on models and controllers respectively.
-  desc &quot;Run functional and unit tests, and get coverage for both.&quot;
-  task :full do
-    Rake::Task['rcov:models'].invoke
-    Rake::Task['rcov:controllers'].invoke
-  end
-  
-  # Runs all unit and functional tests, and determines
-  # coverage on models and controllers respectively, ignoring errors.
   desc &quot;Run functional and unit tests, and get coverage for both, ignoring errors.&quot;
   task :report do
-    begin
-      Rake::Task['rcov:models'].invoke
-    ensure
-      begin
-        Rake::Task['rcov:controllers'].invoke
-      ensure
-        units = File.open(&quot;#{Dir.pwd}/coverage/units/index.html&quot;,&quot;r&quot;).read
-        units = units[units.index(&quot;coverage_code&quot;)+15,10]
-        units = units[0,units.index(&quot;&lt;&quot;)]
-        functionals = File.open(&quot;#{Dir.pwd}/coverage/functionals/index.html&quot;,&quot;r&quot;).read
-        functionals = functionals[functionals.index(&quot;coverage_code&quot;)+15,10]
-        functionals = functionals[0,functionals.index(&quot;&lt;&quot;)]
-        puts &quot;+-----------------------------+&quot;
-        puts &quot;| UNIT COVERAGE:       #{units.ljust(6)} |&quot;
-        puts &quot;| FUNCTIONAL COVERAGE: #{functionals.ljust(6)} |&quot;
-        puts &quot;+-----------------------------+&quot;
-        to_write = &quot;&lt;html&gt;&lt;body&gt;&lt;h1&gt;Rcov Report&lt;/h1&gt;
-        &lt;div style=\&quot;width:100%; height:50px; border: 1px solid black\&quot;&gt;&lt;div style=\&quot;height: 50px; width: #{units}%; background-color: #33FF00; font-size: 18pt; font-style: bold\&quot;&gt;&lt;a href=\&quot;units/index.html\&quot;&gt;Unit: #{units}&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
-        &lt;div style=\&quot;width:100%; height:50px; border: 1px solid black\&quot;&gt;&lt;div style=\&quot;height: 50px; width: #{functionals}%; background-color: #33FF00; font-size: 18pt; font-style: bold\&quot;&gt;&lt;a href=\&quot;functionals/index.html\&quot;&gt;Functional: #{functionals}&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
-        &lt;/body&gt;&lt;/html&gt;&quot;
-        File.open(&quot;coverage/report.html&quot;, &quot;w&quot;) do |f|
-      		f.puts to_write
-      	end
-      	
-      	if PLATFORM['darwin']
-          system(&quot;open #{pwd}/coverage/report.html&quot;)
-        end
-      end
-    end
+    Rake::Task['test:rcov:report'].invoke
+  end
+  
+  desc &quot;Run functional and unit tests, and get coverage for both.&quot;
+  task :full do
+    Rake::Task['test:rcov:full'].invoke
   end
   
 end</diff>
      <filename>tasks/rcov.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8a167049c473bf4fd537fcc250e6ee9df022d990</id>
    </parent>
  </parents>
  <author>
    <name>Brian Hogan</name>
    <email>brianhogan@napcs.com</email>
  </author>
  <url>http://github.com/napcs/lazy_developer/commit/19a24de8482b7546b30531d42d24e10d22359a36</url>
  <id>19a24de8482b7546b30531d42d24e10d22359a36</id>
  <committed-date>2009-06-12T15:00:38-07:00</committed-date>
  <authored-date>2009-06-12T15:00:38-07:00</authored-date>
  <message>rspec model, controller, view, lib, and helper isolated coverage, updated docs, bumped version to 1.1.7, and moved the rcov test:unit tasks around</message>
  <tree>a394cb012e714a4289259115b4a541ef4c14bdee</tree>
  <committer>
    <name>Brian Hogan</name>
    <email>brianhogan@napcs.com</email>
  </committer>
</commit>
