<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Elements of Testing Style</title>
	<atom:link href="http://www.pathf.com/blogs/2009/07/elements-of-testing-style/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pathf.com/blogs/2009/07/elements-of-testing-style/</link>
	<description>Running commentary about agile development, user experience design and Ajax.</description>
	<lastBuildDate>Fri, 05 Mar 2010 19:33:43 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Morgan</title>
		<link>http://www.pathf.com/blogs/2009/07/elements-of-testing-style/comment-page-1/#comment-6923</link>
		<dc:creator>Morgan</dc:creator>
		<pubDate>Tue, 07 Jul 2009 08:18:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=3165#comment-6923</guid>
		<description>Greetings,
You mention that Shoulda macros rely on metaprogramming, and that&#039;s my problem with them.  I like Shoulda a lot; it&#039;s my basic testing platform, but I feel strongly that the macro system encourages a bad test design.

Basically, because the macro &#039;creates&#039; code in the macro definition file, there&#039;s no association with a particular line of code in the original test file.  This leads to stacktraces (on error) which appear to be completely unrelated to the actual test file, and potentially a lot of digging to figure out where the problem is.

So while I agree that Shoulda (and similar libraries) are very useful for context and the &#039;should&#039; testing syntax, I&#039;d warn against the macro functionality as having a good chance of falling into the &#039;clever&#039; trap.

For the &#039;inner setup first&#039;, I think what might work is something like &#039;acts_like &quot;{other context}&quot;&#039;, which would run the setup from the named context before running the tests.  I _think_ the Context gem has (or had) something like that, but Context has other problems that made it not work well for me, so I fell back to Shoulda, and never explored that too much.

--  Morgan</description>
		<content:encoded><![CDATA[<p>Greetings,<br />
You mention that Shoulda macros rely on metaprogramming, and that&#8217;s my problem with them.  I like Shoulda a lot; it&#8217;s my basic testing platform, but I feel strongly that the macro system encourages a bad test design.</p>
<p>Basically, because the macro &#8216;creates&#8217; code in the macro definition file, there&#8217;s no association with a particular line of code in the original test file.  This leads to stacktraces (on error) which appear to be completely unrelated to the actual test file, and potentially a lot of digging to figure out where the problem is.</p>
<p>So while I agree that Shoulda (and similar libraries) are very useful for context and the &#8217;should&#8217; testing syntax, I&#8217;d warn against the macro functionality as having a good chance of falling into the &#8216;clever&#8217; trap.</p>
<p>For the &#8216;inner setup first&#8217;, I think what might work is something like &#8216;acts_like &#8220;{other context}&#8221;&#8216;, which would run the setup from the named context before running the tests.  I _think_ the Context gem has (or had) something like that, but Context has other problems that made it not work well for me, so I fell back to Shoulda, and never explored that too much.</p>
<p>&#8211;  Morgan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ehqhvm</title>
		<link>http://www.pathf.com/blogs/2009/07/elements-of-testing-style/comment-page-1/#comment-6891</link>
		<dc:creator>ehqhvm</dc:creator>
		<pubDate>Fri, 03 Jul 2009 15:17:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=3165#comment-6891</guid>
		<description>be sure to check out Contest, a great gem for nested contexts, extremely light and efficient: http://blog.citrusbyte.com/2009/05/19/introducing-contest/</description>
		<content:encoded><![CDATA[<p>be sure to check out Contest, a great gem for nested contexts, extremely light and efficient: <a href="http://blog.citrusbyte.com/2009/05/19/introducing-contest/" rel="nofollow">http://blog.citrusbyte.com/2009/05/19/introducing-contest/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.230 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-03-17 16:51:54 -->
