<?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: Behaviour Driven Development syntax</title>
	<atom:link href="http://blog.robbowley.net/2009/02/04/bdd-syntax/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.robbowley.net/2009/02/04/bdd-syntax/</link>
	<description></description>
	<lastBuildDate>Thu, 22 Sep 2011 10:38:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: rob bowley - adventures in software development &#187; Blog Archive &#187; Thoughts on testing .Net code with RSpec &#38; IronRuby</title>
		<link>http://blog.robbowley.net/2009/02/04/bdd-syntax/#comment-219</link>
		<dc:creator>rob bowley - adventures in software development &#187; Blog Archive &#187; Thoughts on testing .Net code with RSpec &#38; IronRuby</dc:creator>
		<pubDate>Sun, 22 Feb 2009 17:20:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robbowley.net/?p=185#comment-219</guid>
		<description>[...] a previous article I said I&#8217;d like to test my .Net code using RSpec so I&#8217;ve spent some time this weekend [...] </description>
		<content:encoded><![CDATA[<p>[...] a previous article I said I&#8217;d like to test my .Net code using RSpec so I&#8217;ve spent some time this weekend [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://blog.robbowley.net/2009/02/04/bdd-syntax/#comment-218</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Fri, 20 Feb 2009 14:22:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robbowley.net/?p=185#comment-218</guid>
		<description>I experimented with this kind of nesting in C#, using nested classes. A spec looks like this:
http://joshchisholm.com/svn/narrative/trunk/Narrative.Specs.Example/StackSpecs.cs
Grab the trunk of that project if you are interested.</description>
		<content:encoded><![CDATA[<p>I experimented with this kind of nesting in C#, using nested classes. A spec looks like this:<br />
<a href="http://joshchisholm.com/svn/narrative/trunk/Narrative.Specs.Example/StackSpecs.cs" rel="nofollow">http://joshchisholm.com/svn/narrative/trunk/Narrative.Specs.Example/StackSpecs.cs</a><br />
Grab the trunk of that project if you are interested.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Wynne</title>
		<link>http://blog.robbowley.net/2009/02/04/bdd-syntax/#comment-217</link>
		<dc:creator>Matt Wynne</dc:creator>
		<pubDate>Thu, 05 Feb 2009 14:57:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robbowley.net/?p=185#comment-217</guid>
		<description>Rob,

The real beauty of RSpec for unit testing is that it allows you to create subclasses of your TestFixture class that specialize the scenario you&#039;re testing for.

I think this is possible with the xUnit frameworks, but it&#039;s not easy. It&#039;s a pattern I tried a few times with NUnit and felt pretty good, in some cases at least.

So for example in RSpec when you do this...

describe &quot;a user&quot;
  before(:each) do
    @user = TestFactory.create(:user)
  end
  describe &quot;who is view direct&quot; do
    before(:each) do
      @user.status = :view_direct
    end
    
    it &quot;should immediately get access to previews&quot; do
      ...
    end
  end

  describe &quot;who is view by request&quot; do
  end
end

...what you&#039;re actually doing is creating a hierarchy of test classes on the fly, because #describe is a factory method for test cases.

I imagine you could replicate something like this C#, but it might be quite cumbersome to change.</description>
		<content:encoded><![CDATA[<p>Rob,</p>
<p>The real beauty of RSpec for unit testing is that it allows you to create subclasses of your TestFixture class that specialize the scenario you&#8217;re testing for.</p>
<p>I think this is possible with the xUnit frameworks, but it&#8217;s not easy. It&#8217;s a pattern I tried a few times with NUnit and felt pretty good, in some cases at least.</p>
<p>So for example in RSpec when you do this&#8230;</p>
<p>describe &#8220;a user&#8221;<br />
  before(:each) do<br />
    @user = TestFactory.create(:user)<br />
  end<br />
  describe &#8220;who is view direct&#8221; do<br />
    before(:each) do<br />
      @user.status = :view_direct<br />
    end</p>
<p>    it &#8220;should immediately get access to previews&#8221; do<br />
      &#8230;<br />
    end<br />
  end</p>
<p>  describe &#8220;who is view by request&#8221; do<br />
  end<br />
end</p>
<p>&#8230;what you&#8217;re actually doing is creating a hierarchy of test classes on the fly, because #describe is a factory method for test cases.</p>
<p>I imagine you could replicate something like this C#, but it might be quite cumbersome to change.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

