<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: rake code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 21 Aug 2008 05:16:26 GMT</pubDate>
    <description>DZone Snippets: rake code</description>
    <item>
      <title>rcov rake task for rails project</title>
      <link>http://snippets.dzone.com/posts/show/4525</link>
      <description>This task will create a folder (doc/coverage) then run all of your tests and produce HTML with code coverage information in that folder. If you are on a mac it will even open the index.html file up for you automatically&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# this requires the RCOV gem to be installed on your system&lt;br /&gt;namespace :test do&lt;br /&gt;  desc "Generate code coverage with rcov"&lt;br /&gt;  task :coverage do&lt;br /&gt;    rm_f "doc/coverage/coverage.data"&lt;br /&gt;    rm_f "doc/coverage"&lt;br /&gt;    mkdir "doc/coverage"&lt;br /&gt;    rcov = %(rcov --rails --aggregate doc/coverage/coverage.data --text-summary -Ilib --html -o doc/coverage test/**/*_test.rb)&lt;br /&gt;    system rcov&lt;br /&gt;    system "open doc/coverage/index.html" if PLATFORM['darwin']&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 11 Sep 2007 16:13:45 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4525</guid>
      <author>akbloom (Andrew Bloom)</author>
    </item>
  </channel>
</rss>
