<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/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>I.NFECTIO.US: Tagging Your Test Cases</title>
    <link>http://i.nfectio.us/articles/2006/09/17/tagging-your-test-cases</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>"Nothing in life is worth doing if you have no life while doing it"</description>
    <item>
      <title>Tagging Your Test Cases</title>
      <description>Here's a quick way to follow your tests a little more closely in your test.log.

In your test setup, add the following line:

&lt;pre&gt;
def setup
  RAILS_DEFAULT_LOGGER.debug "\n\e[0;31mRUNNING TEST CASE: #{name}\e[m\n"
end
&lt;/pre&gt;

When you run your tests, you will now see something similar to this.
&lt;img src="http://i.nfectio.us/files/taggedtest.png"/&gt;</description>
      <pubDate>Sun, 17 Sep 2006 22:59:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:49d4b05d-ef75-4382-b9cd-b64c48a8ccaa</guid>
      <author>Bob Silva</author>
      <link>http://i.nfectio.us/articles/2006/09/17/tagging-your-test-cases</link>
      <category>Ruby on Rails</category>
      <category>rails</category>
      <category>testing</category>
    </item>
    <item>
      <title>"Tagging Your Test Cases" by Rob Sanheim</title>
      <description>Thanks for that solution, Simon.

I add something similar to my setup calls, and once spent a good amount of time trying to get it into test::unit.  After much frustration, I gave up - there were just too many places that setup was getting redefined and aliased.

</description>
      <pubDate>Tue, 10 Oct 2006 09:51:23 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:10f1838d-57a6-4b2f-a4ca-16bbeebd8d8d</guid>
      <link>http://i.nfectio.us/articles/2006/09/17/tagging-your-test-cases#comment-187</link>
    </item>
    <item>
      <title>"Tagging Your Test Cases" by Simon Nicholls</title>
      <description>I think the setup method is a difficult extension point currently, &amp; would require Module/Kernel hacks for method definition &amp; method addition listening. Probably something like the code below would be enough, &amp; is a decent enough fit since our logging does indeed aim to extend the test run rather than perform setup. Could be added directly to test_helper of course, but best wrapped as a Module

&lt;pre&gt;
alias_method :old_run, :run unless method_defined?(:old_run)
def run(result, &amp;progress_block)
  RAILS_DEFAULT_LOGGER.debug "\n\e[0;31mRUNNING TEST CASE: #{name}\e[m\n"
  old_run(result, &amp;progress_block)
end
&lt;/pre&gt;

There are surely better ways than this though. Would be great to hear if anyone has done this kind of TestCase extension work</description>
      <pubDate>Tue, 26 Sep 2006 06:57:54 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:09e1ad06-6f00-435d-9879-339053c3e24e</guid>
      <link>http://i.nfectio.us/articles/2006/09/17/tagging-your-test-cases#comment-161</link>
    </item>
    <item>
      <title>"Tagging Your Test Cases" by Bob Silva</title>
      <description>I'm sure you can reopen some Test::Unit classes to make it happen. I didn't look into it at all.
</description>
      <pubDate>Sun, 24 Sep 2006 12:27:50 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:8ccd1c64-4586-473a-b219-6d70fe7dc959</guid>
      <link>http://i.nfectio.us/articles/2006/09/17/tagging-your-test-cases#comment-155</link>
    </item>
    <item>
      <title>"Tagging Your Test Cases" by Mariano</title>
      <description>One of the things that when you see them you know that you missed it all along ;-)

Isn't there a better place to put it? Somewhere were all Tests will benefit from it?</description>
      <pubDate>Sun, 24 Sep 2006 01:58:11 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:6d5430c5-515d-4710-82a4-aab12c288f58</guid>
      <link>http://i.nfectio.us/articles/2006/09/17/tagging-your-test-cases#comment-152</link>
    </item>
    <item>
      <title>"Tagging Your Test Cases" by Carlos Gabaldon</title>
      <description>Very nice!  Thanks for the tip!</description>
      <pubDate>Mon, 18 Sep 2006 23:18:48 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:5c1370b5-4c63-4f58-9e9e-c31c5766acd4</guid>
      <link>http://i.nfectio.us/articles/2006/09/17/tagging-your-test-cases#comment-144</link>
    </item>
    <item>
      <title>"Tagging Your Test Cases" by Bob Silva</title>
      <description>Fixed, sorry about that.</description>
      <pubDate>Mon, 18 Sep 2006 17:32:34 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:6f17e14f-de8e-4cc6-a9c4-85046a0091a7</guid>
      <link>http://i.nfectio.us/articles/2006/09/17/tagging-your-test-cases#comment-142</link>
    </item>
    <item>
      <title>"Tagging Your Test Cases" by Lee O'Mara</title>
      <description>Not meaning to nitpick (and I would have sent this via email, but I couldn't locate your adderess), your IMG tags for this post aren't closed and that's causing problems downstream (eg. planet caboose's feed, at least in Vienna)</description>
      <pubDate>Mon, 18 Sep 2006 07:54:26 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:ffa5a418-c772-41b9-a7ac-2133efbb926f</guid>
      <link>http://i.nfectio.us/articles/2006/09/17/tagging-your-test-cases#comment-140</link>
    </item>
  </channel>
</rss>
