<?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: RSpec Shared Example before(:each) Gotcha</title>
	<atom:link href="http://www.claytonlz.com/index.php/2009/03/rspec-shared-example-before-each-gotcha/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.claytonlz.com/index.php/2009/03/rspec-shared-example-before-each-gotcha/</link>
	<description>Ruby on Rails Developer</description>
	<lastBuildDate>Sat, 28 Aug 2010 16:06:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: John D. Rowell</title>
		<link>http://www.claytonlz.com/index.php/2009/03/rspec-shared-example-before-each-gotcha/comment-page-1/#comment-1248</link>
		<dc:creator>John D. Rowell</dc:creator>
		<pubDate>Tue, 08 Dec 2009 13:17:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.claytonlz.com/?p=124#comment-1248</guid>
		<description>I just got bitten by this, thanks for sharing. Will try the shared_examples_for method above.</description>
		<content:encoded><![CDATA[<p>I just got bitten by this, thanks for sharing. Will try the shared_examples_for method above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: W. Andrew Loe III</title>
		<link>http://www.claytonlz.com/index.php/2009/03/rspec-shared-example-before-each-gotcha/comment-page-1/#comment-672</link>
		<dc:creator>W. Andrew Loe III</dc:creator>
		<pubDate>Wed, 08 Jul 2009 00:52:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.claytonlz.com/?p=124#comment-672</guid>
		<description>To clarify, shared_examples_for and describe blocks are not interchangeable, what you probably really want to do is wrap your describe in an shared examples for block.

shared_examples_for &quot;foo&quot; do
  before(:each) do
    # This will get run everywhere which is not what you expect!
  end

  describe &quot;#foo&quot; do
    before(:each) do
      # This will get run how you expect, before only those specs in this describe block
    end

    it &quot;should run the describe block above me&quot;
      # will pass
    end
  end
end</description>
		<content:encoded><![CDATA[<p>To clarify, shared_examples_for and describe blocks are not interchangeable, what you probably really want to do is wrap your describe in an shared examples for block.</p>
<p>shared_examples_for &#8220;foo&#8221; do<br />
  before(:each) do<br />
    # This will get run everywhere which is not what you expect!<br />
  end</p>
<p>  describe &#8220;#foo&#8221; do<br />
    before(:each) do<br />
      # This will get run how you expect, before only those specs in this describe block<br />
    end</p>
<p>    it &#8220;should run the describe block above me&#8221;<br />
      # will pass<br />
    end<br />
  end<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: W. Andrew Loe III</title>
		<link>http://www.claytonlz.com/index.php/2009/03/rspec-shared-example-before-each-gotcha/comment-page-1/#comment-671</link>
		<dc:creator>W. Andrew Loe III</dc:creator>
		<pubDate>Wed, 08 Jul 2009 00:27:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.claytonlz.com/?p=124#comment-671</guid>
		<description>It appears to work as expected if you put a describe block inside the shared_examples_for block. Took me a while to figure this out!</description>
		<content:encoded><![CDATA[<p>It appears to work as expected if you put a describe block inside the shared_examples_for block. Took me a while to figure this out!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
