<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Custom Shoulda macros &#8212; a tutorial</title>
	<atom:link href="http://szeryf.wordpress.com/2010/03/01/custom-shoulda-macros-a-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://szeryf.wordpress.com/2010/03/01/custom-shoulda-macros-a-tutorial/</link>
	<description>The blog with the bug.</description>
	<lastBuildDate>Wed, 10 Apr 2013 20:31:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: szeryf</title>
		<link>http://szeryf.wordpress.com/2010/03/01/custom-shoulda-macros-a-tutorial/#comment-1214</link>
		<dc:creator><![CDATA[szeryf]]></dc:creator>
		<pubDate>Thu, 13 Jan 2011 23:11:08 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/?p=272#comment-1214</guid>
		<description><![CDATA[@Snuggs: you can use some special key in your options hash, for example:
&lt;pre&gt;
  should_delegate :category, :to =&gt; :post, :args_for_new =&gt; [1, 2, 3]
&lt;/pre&gt;

Then use it in the &lt;code&gt;should_delegate&lt;/code&gt; method:
&lt;pre&gt;
  def self.should_delegate *args
     # snip...
     should &quot;delegate #{name} to #{to_class}&quot; do
       args_for_new = opts[:args_for_new] &#124;&#124; []
       to = to_class.send(:new, args_for_new)
 &lt;/pre&gt;

I hope you get the idea :)]]></description>
		<content:encoded><![CDATA[<p>@Snuggs: you can use some special key in your options hash, for example:</p>
<pre>
  should_delegate :category, :to =&gt; :post, :args_for_new =&gt; [1, 2, 3]
</pre>
<p>Then use it in the <code>should_delegate</code> method:</p>
<pre>
  def self.should_delegate *args
     # snip...
     should "delegate #{name} to #{to_class}" do
       args_for_new = opts[:args_for_new] || []
       to = to_class.send(:new, args_for_new)
 </pre>
<p>I hope you get the idea :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Snuggs</title>
		<link>http://szeryf.wordpress.com/2010/03/01/custom-shoulda-macros-a-tutorial/#comment-1213</link>
		<dc:creator><![CDATA[Snuggs]]></dc:creator>
		<pubDate>Thu, 13 Jan 2011 22:07:10 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/?p=272#comment-1213</guid>
		<description><![CDATA[How can you test that an object has arguments or not.  This code worked PERFECTLY until I came across one of my objects that needed an argument passed to new :-/]]></description>
		<content:encoded><![CDATA[<p>How can you test that an object has arguments or not.  This code worked PERFECTLY until I came across one of my objects that needed an argument passed to new :-/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Barton</title>
		<link>http://szeryf.wordpress.com/2010/03/01/custom-shoulda-macros-a-tutorial/#comment-1156</link>
		<dc:creator><![CDATA[Michael Barton]]></dc:creator>
		<pubDate>Fri, 24 Sep 2010 21:40:08 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/?p=272#comment-1156</guid>
		<description><![CDATA[Agree with the above comment. This was really helpful and should be part of the documentation.]]></description>
		<content:encoded><![CDATA[<p>Agree with the above comment. This was really helpful and should be part of the documentation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jarl Friis</title>
		<link>http://szeryf.wordpress.com/2010/03/01/custom-shoulda-macros-a-tutorial/#comment-1138</link>
		<dc:creator><![CDATA[Jarl Friis]]></dc:creator>
		<pubDate>Mon, 28 Jun 2010 20:00:45 +0000</pubDate>
		<guid isPermaLink="false">http://szeryf.wordpress.com/?p=272#comment-1138</guid>
		<description><![CDATA[Fantastic tutorial. Just what I was looking for. And then you are also a great author. This kind of stuff should be part of the shoulda documentation.]]></description>
		<content:encoded><![CDATA[<p>Fantastic tutorial. Just what I was looking for. And then you are also a great author. This kind of stuff should be part of the shoulda documentation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
