<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Lucid &#187; tests</title>
	<atom:link href="http://thelucid.com/tag/tests/feed/" rel="self" type="application/rss+xml" />
	<link>http://thelucid.com</link>
	<description>The Lightweight Ramblings of Jamie Hill</description>
	<lastBuildDate>Thu, 26 Jan 2012 13:52:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using Rcov to measure the test coverage of Rails plugins</title>
		<link>http://thelucid.com/2007/08/24/using-rcov-to-measure-the-test-coverage-of-rails-plugins/</link>
		<comments>http://thelucid.com/2007/08/24/using-rcov-to-measure-the-test-coverage-of-rails-plugins/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 23:43:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[coverage]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rcov]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://c533fc04-524b-4de6-bd09-fe3ed45a3a0f</guid>
		<description><![CDATA[To view the coverage of your plugins using Rcov, first install the rcov gem with sudo gem install rcov, then copy and paste the following onto the end of the Rakefile inside your plugin directory: require 'rcov/rcovtask' &#160; desc 'Measures test coverage using rcov' namespace :rcov do desc 'Output unit test coverage of plugin.' Rcov::RcovTask.new&#40;:unit&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>To view the coverage of your plugins using Rcov, first install the <code>rcov</code> gem with <code>sudo gem install rcov</code>, then copy and paste the following onto the end of the <code>Rakefile</code> inside your plugin directory:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rcov/rcovtask'</span>
&nbsp;
desc <span style="color:#996600;">'Measures test coverage using rcov'</span>
namespace <span style="color:#ff3333; font-weight:bold;">:rcov</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  desc <span style="color:#996600;">'Output unit test coverage of plugin.'</span>
  <span style="color:#6666ff; font-weight:bold;">Rcov::RcovTask</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:unit</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>rcov<span style="color:#006600; font-weight:bold;">|</span>
    rcov.<span style="color:#9900CC;">pattern</span>    = <span style="color:#996600;">'test/unit/**/*_test.rb'</span>
    rcov.<span style="color:#9900CC;">output_dir</span> = <span style="color:#996600;">'rcov'</span>
    rcov.<span style="color:#9900CC;">verbose</span>    = <span style="color:#0000FF; font-weight:bold;">true</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  desc <span style="color:#996600;">'Output functional test coverage of plugin.'</span>
  <span style="color:#6666ff; font-weight:bold;">Rcov::RcovTask</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:functional</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>rcov<span style="color:#006600; font-weight:bold;">|</span>
    rcov.<span style="color:#9900CC;">pattern</span>    = <span style="color:#996600;">'test/functional/**/*_test.rb'</span>
    rcov.<span style="color:#9900CC;">output_dir</span> = <span style="color:#996600;">'rcov'</span>
    rcov.<span style="color:#9900CC;">verbose</span>    = <span style="color:#0000FF; font-weight:bold;">true</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>You can now simply run <code>rake rcov</code> from inside your plugin directory which will generate an <code>rcov</code> directory with the results. Open <code>rcov/index.html</code> (if you are on OSX this will open automatically) in a browser to view the results.</p>
<p>Thanks to &#8220;Mike Clark&#8221;:http://clarkware.com/cgi/blosxom for his &#8220;Rcov rake task for Rails&#8221;:http://clarkware.com/cgi/blosxom/2007/01/05#RcovRakeTask which this task is based on.</p>
<p>*Update (11-11-08):* Changed code to use the RcovTask class.</p>
]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/08/24/using-rcov-to-measure-the-test-coverage-of-rails-plugins/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

