<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Musings of a Trained Monkey: Rails and rcov...</title>
    <link>http://www.stevelongdo.com/articles/2006/04/27/rails-and-rcov</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Rails and rcov...</title>
      <description>There is an &lt;a href="http://thread.gmane.org/gmane.comp.lang.ruby.rails.core/1073/focus=1073"&gt;interesting thread&lt;/a&gt; going on the rails-core mailing list about testing coverage and documentation.
I learned about &lt;a href="http://eigenclass.org/hiki.rb?rcov"&gt;rcov&lt;/a&gt;  which provides testing coverage metrics for &lt;a href="http://ruby-lang.org"&gt;Ruby&lt;/a&gt; applications. &lt;strike&gt;Here are links to the results so far&lt;/strike&gt;Took this content down due to it being stale:
&lt;ul&gt;
&lt;li&gt;&lt;strike&gt;ActionMailer&lt;/strike&gt;&lt;br /&gt;rcov&amp;nbsp;-x&amp;nbsp;activerecord,activesupport,actionpack&amp;nbsp;test/*.rb&lt;/li&gt;
&lt;li&gt;&lt;strike&gt;ActionPack(top level only)&lt;/strike&gt;&lt;br /&gt;rcov&amp;nbsp;-x&amp;nbsp;activerecord,activesupport,actionmailer&amp;nbsp;test/*.rb&lt;/li&gt;
&lt;li&gt;&lt;strike&gt;ActionWebService&lt;/strike&gt;&lt;br /&gt;rcov&amp;nbsp;-x&amp;nbsp;activerecord,activesupport,actionpack,actionmailer&amp;nbsp;test/*.rb&lt;/li&gt;
&lt;/ul&gt;
I modified &lt;a href="http://eigenclass.org/hiki.rb?rcov"&gt;rcov&lt;/a&gt; a bit trying to get it to work covering the &lt;a href="http://www.rubyonrails.org/"&gt;Rails codebase&lt;/a&gt;.  The results were somewhat mixed, but only railties blew up strictly in &lt;a href="http://eigenclass.org/hiki.rb?rcov"&gt;rcov&lt;/a&gt; with a SystemStackError. Showing the complete test coverage of ActiveRecord in particular will present a challenge due to the number of database connectors it has.&lt;br /&gt;&lt;br /&gt;As an example of differences between running rake test versus rcov test*.rb, in Activerecord there is a test case named aaa_create_tables_test that runs fine with rake, but with &lt;a href="http://eigenclass.org/hiki.rb?rcov"&gt;rcov&lt;/a&gt; there is a load error because aaa_create_tables_test requires abstract_unit.rb which simple test/*.rb has loaded yet because &lt;b&gt;aa&lt;/b&gt;a_create_tables_test comes before &lt;b&gt;ab&lt;/b&gt;stract_unit.  I have gotten farther with loading abstract_unit.rb explicitly rcov -x actionpack,activesupport test/abstract_unit.rb test/*.rb but it would be better if I could figure out how to wrap rake inside of &lt;a href="http://eigenclass.org/hiki.rb?rcov"&gt;rcov&lt;/a&gt;...</description>
      <pubDate>Thu, 27 Apr 2006 05:14:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:18e23f3e-ab2b-438e-96ec-ce1cd9099dac</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/04/27/rails-and-rcov</link>
      <category>rails</category>
      <category>ruby</category>
      <category>rcov</category>
      <category>testing</category>
      <category>coverage</category>
    </item>
  </channel>
</rss>
