<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
  <channel>
    <title>Eleutian SpeakENG Development Blog - bdd</title>
    <link>http://blog.eleutian.com/</link>
    <description />
    <language>en-us</language>
    <copyright>Eleutian Technology</copyright>
    <lastBuildDate>Sun, 19 Oct 2008 22:18:25 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>aaron@eleutian.com</managingEditor>
    <webMaster>aaron@eleutian.com</webMaster>
    <item>
      <trackback:ping>http://blog.eleutian.com/Trackback.aspx?guid=23994350-beff-46f3-ba72-c072e0ea0417</trackback:ping>
      <pingback:server>http://blog.eleutian.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eleutian.com/PermaLink,guid,23994350-beff-46f3-ba72-c072e0ea0417.aspx</pingback:target>
      <dc:creator>Aaron</dc:creator>
      <wfw:comment>http://blog.eleutian.com/CommentView,guid,23994350-beff-46f3-ba72-c072e0ea0417.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eleutian.com/SyndicationService.asmx/GetEntryCommentsRss?guid=23994350-beff-46f3-ba72-c072e0ea0417</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <h2>Does ReSharper want to make your specs look like this?
</h2>
        <img height="384" alt="Superfluous privates, indentation and warnings" src="http://content.screencast.com/users/ajensen/folders/Jing/media/5626ca97-5e0c-43d8-9db1-c1f7bac75fb9/2008-10-19_1449.png" width="613" border="0" />
        <h2>But you want your specs to look like this?
</h2>
        <img height="386" alt="clean text with less noise" src="http://content.screencast.com/users/ajensen/folders/Jing/media/56b442ae-5b4d-4577-9807-762412ae5fbc/2008-10-19_1503.png" width="556" border="0" />
        <h2>Just follow these easy steps:
</h2>
        <ol style="font-size: 1.6em">
          <li>
            <p>
Go to Resharper&gt;Options
</p>
            <img height="270" src="http://content.screencast.com/users/ajensen/folders/Jing/media/6812b390-e28c-4ff5-b47e-c4a803a44f94/2008-10-19_1454.png" width="226" border="0" />
          </li>
          <li>
            <p>
Go to Languages&gt;C#&gt;Formatting Style&gt;Other
</p>
            <img height="490" src="http://content.screencast.com/users/ajensen/folders/Jing/media/689e080c-83e2-479b-88fd-00b1578d5695/2008-10-19_1455.png" width="190" border="0" />
          </li>
          <li>
            <p>
Uncheck Modifiers&gt;Use explicit private modifier
</p>
            <img height="101" src="http://content.screencast.com/users/ajensen/folders/Jing/media/d1209891-e09b-4312-a545-f00a1cef1149/2008-10-19_1456.png" width="444" border="0" />
          </li>
          <li>
            <p>
Uncheck Other&gt;Indent anonymous method body and hit OK
</p>
            <img height="158" src="http://content.screencast.com/users/ajensen/folders/Jing/media/a652911f-6e7c-4ee1-ae8b-7f63f605dbde/2008-10-19_1458.png" width="390" border="0" />
          </li>
          <li>
            <p>
Go to your project properties&gt;Build and suppress warning 169
</p>
            <img height="363" src="http://content.screencast.com/users/ajensen/folders/Jing/media/74e14bde-982d-456d-9512-f45c29015661/2008-10-19_1511.png" width="493" border="0" />
          </li>
          <li>
            <p>
Enjoy!
</p>
          </li>
        </ol>
        <img width="0" height="0" src="http://blog.eleutian.com/aggbug.ashx?id=23994350-beff-46f3-ba72-c072e0ea0417" />
      </body>
      <title>Getting ReSharper and VS to play nice with MSpec</title>
      <guid isPermaLink="false">http://blog.eleutian.com/PermaLink,guid,23994350-beff-46f3-ba72-c072e0ea0417.aspx</guid>
      <link>http://blog.eleutian.com/2008/10/19/GettingReSharperAndVSToPlayNiceWithMSpec.aspx</link>
      <pubDate>Sun, 19 Oct 2008 22:18:25 GMT</pubDate>
      <description>&lt;h2&gt;Does ReSharper want to make your specs look like this?
&lt;/h2&gt;
&lt;img height="384" alt="Superfluous privates, indentation and warnings" src="http://content.screencast.com/users/ajensen/folders/Jing/media/5626ca97-5e0c-43d8-9db1-c1f7bac75fb9/2008-10-19_1449.png" width="613" border="0" /&gt; 
&lt;h2&gt;But you want your specs to look like this?
&lt;/h2&gt;
&lt;img height="386" alt="clean text with less noise" src="http://content.screencast.com/users/ajensen/folders/Jing/media/56b442ae-5b4d-4577-9807-762412ae5fbc/2008-10-19_1503.png" width="556" border="0" /&gt; 
&lt;h2&gt;Just follow these easy steps:
&lt;/h2&gt;
&lt;ol style="font-size: 1.6em"&gt;
&lt;li&gt;
&lt;p&gt;
Go to Resharper&amp;gt;Options
&lt;/p&gt;
&lt;img height="270" src="http://content.screencast.com/users/ajensen/folders/Jing/media/6812b390-e28c-4ff5-b47e-c4a803a44f94/2008-10-19_1454.png" width="226" border="0" /&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
Go to Languages&amp;gt;C#&amp;gt;Formatting Style&amp;gt;Other
&lt;/p&gt;
&lt;img height="490" src="http://content.screencast.com/users/ajensen/folders/Jing/media/689e080c-83e2-479b-88fd-00b1578d5695/2008-10-19_1455.png" width="190" border="0" /&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
Uncheck Modifiers&amp;gt;Use explicit private modifier
&lt;/p&gt;
&lt;img height="101" src="http://content.screencast.com/users/ajensen/folders/Jing/media/d1209891-e09b-4312-a545-f00a1cef1149/2008-10-19_1456.png" width="444" border="0" /&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
Uncheck Other&amp;gt;Indent anonymous method body and hit OK
&lt;/p&gt;
&lt;img height="158" src="http://content.screencast.com/users/ajensen/folders/Jing/media/a652911f-6e7c-4ee1-ae8b-7f63f605dbde/2008-10-19_1458.png" width="390" border="0" /&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
Go to your project properties&amp;gt;Build and suppress warning 169
&lt;/p&gt;
&lt;img height="363" src="http://content.screencast.com/users/ajensen/folders/Jing/media/74e14bde-982d-456d-9512-f45c29015661/2008-10-19_1511.png" width="493" border="0" /&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
Enjoy!
&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;img width="0" height="0" src="http://blog.eleutian.com/aggbug.ashx?id=23994350-beff-46f3-ba72-c072e0ea0417" /&gt;</description>
      <comments>http://blog.eleutian.com/CommentView,guid,23994350-beff-46f3-ba72-c072e0ea0417.aspx</comments>
      <category>bdd</category>
      <category>mspec</category>
      <category>resharper</category>
    </item>
    <item>
      <trackback:ping>http://blog.eleutian.com/Trackback.aspx?guid=3d64e14f-379a-4bf1-b167-6d6eb8ae0f33</trackback:ping>
      <pingback:server>http://blog.eleutian.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eleutian.com/PermaLink,guid,3d64e14f-379a-4bf1-b167-6d6eb8ae0f33.aspx</pingback:target>
      <dc:creator>Aaron</dc:creator>
      <wfw:comment>http://blog.eleutian.com/CommentView,guid,3d64e14f-379a-4bf1-b167-6d6eb8ae0f33.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eleutian.com/SyndicationService.asmx/GetEntryCommentsRss?guid=3d64e14f-379a-4bf1-b167-6d6eb8ae0f33</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Unlike vanilla TDD, the artifacts produced by BDD can and should be read by more than
just developers. Most of us who practice TDD name our tests more or less like this:
</p>
        <pre>MessageBoardControllerTests.Index_WithTenMessages_ReturnsFiveMostRecentFromRepository()</pre>
        <p>
Shifting into Context/Specification style testing, one may be tempted to write specs
like this:
</p>
        <pre>MessageBoardController, when invoking index action when there are ten messages, 
  should return five most recent messages from the repository</pre>
        <p>
The problem with this spec is subtle but important. You often want these specs to
be readable and understandable by a normal person, someone in your business that can
provide you feedback on your specs. Using words like "invoking", "index",
"action" and "repository" are clear indicators that your audience
is another developer. You should use the time writing specs to speak in the language
of the business and to clarify your ubiquitous language. Here's how I'd rewrite this:
</p>
        <pre>Message Board, when viewed
  should show only the five most recent messages</pre>
        <p>
Again, the difference is subtle, but notice how I could show this to anyone in the
company and they would understand exactly what is happening.
</p>
        <p>
There are times for developer speak in specs I believe. If you are specing an API
to be consumed by other developers I think it's ok to use words like "throw"
and "return" because that is what the developers care about when integrating
with an API.
</p>
        <p>
Most of the time however, especially when writing the more UI/System Behavior level
specs, you should consider who your audience is and try to speak like them. The code
itself will provide the detail a developer needs to understand it.
</p>
        <p>
As an aside, this is one of the many reasons I prefer the Context/Specification style
to Given/When/Then style of BDD. Because people already don't speak in Given/When/Then
prose in real life, it makes it even more difficult to write your specs for the intended
audience. It also leads you to use magic numbers and other magic state in your prose
rather than formalizing business concepts and improving your ubiquitous language.
</p>
        <img width="0" height="0" src="http://blog.eleutian.com/aggbug.ashx?id=3d64e14f-379a-4bf1-b167-6d6eb8ae0f33" />
      </body>
      <title>BDD &amp;ndash; Consider your audience</title>
      <guid isPermaLink="false">http://blog.eleutian.com/PermaLink,guid,3d64e14f-379a-4bf1-b167-6d6eb8ae0f33.aspx</guid>
      <link>http://blog.eleutian.com/2008/10/19/BDDNdashConsiderYourAudience.aspx</link>
      <pubDate>Sun, 19 Oct 2008 17:24:03 GMT</pubDate>
      <description>&lt;p&gt;
Unlike vanilla TDD, the artifacts produced by BDD can and should be read by more than
just developers. Most of us who practice TDD name our tests more or less like this:
&lt;/p&gt;
&lt;pre&gt;MessageBoardControllerTests.Index_WithTenMessages_ReturnsFiveMostRecentFromRepository()&lt;/pre&gt;
&lt;p&gt;
Shifting into Context/Specification style testing, one may be tempted to write specs
like this:
&lt;/p&gt;
&lt;pre&gt;MessageBoardController, when invoking index action when there are ten messages, 
  should return five most recent messages from the repository&lt;/pre&gt;
&lt;p&gt;
The problem with this spec is subtle but important. You often want these specs to
be readable and understandable by a normal person, someone in your business that can
provide you feedback on your specs. Using words like &amp;quot;invoking&amp;quot;, &amp;quot;index&amp;quot;,
&amp;quot;action&amp;quot; and &amp;quot;repository&amp;quot; are clear indicators that your audience
is another developer. You should use the time writing specs to speak in the language
of the business and to clarify your ubiquitous language. Here's how I'd rewrite this:
&lt;/p&gt;
&lt;pre&gt;Message Board, when viewed
  should show only the five most recent messages&lt;/pre&gt;
&lt;p&gt;
Again, the difference is subtle, but notice how I could show this to anyone in the
company and they would understand exactly what is happening.
&lt;/p&gt;
&lt;p&gt;
There are times for developer speak in specs I believe. If you are specing an API
to be consumed by other developers I think it's ok to use words like &amp;quot;throw&amp;quot;
and &amp;quot;return&amp;quot; because that is what the developers care about when integrating
with an API.
&lt;/p&gt;
&lt;p&gt;
Most of the time however, especially when writing the more UI/System Behavior level
specs, you should consider who your audience is and try to speak like them. The code
itself will provide the detail a developer needs to understand it.
&lt;/p&gt;
&lt;p&gt;
As an aside, this is one of the many reasons I prefer the Context/Specification style
to Given/When/Then style of BDD. Because people already don't speak in Given/When/Then
prose in real life, it makes it even more difficult to write your specs for the intended
audience. It also leads you to use magic numbers and other magic state in your prose
rather than formalizing business concepts and improving your ubiquitous language.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eleutian.com/aggbug.ashx?id=3d64e14f-379a-4bf1-b167-6d6eb8ae0f33" /&gt;</description>
      <comments>http://blog.eleutian.com/CommentView,guid,3d64e14f-379a-4bf1-b167-6d6eb8ae0f33.aspx</comments>
      <category>bdd</category>
    </item>
    <item>
      <trackback:ping>http://blog.eleutian.com/Trackback.aspx?guid=ff788dca-fce2-4ad7-856d-c1a7745a2517</trackback:ping>
      <pingback:server>http://blog.eleutian.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eleutian.com/PermaLink,guid,ff788dca-fce2-4ad7-856d-c1a7745a2517.aspx</pingback:target>
      <dc:creator>Aaron</dc:creator>
      <wfw:comment>http://blog.eleutian.com/CommentView,guid,ff788dca-fce2-4ad7-856d-c1a7745a2517.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eleutian.com/SyndicationService.asmx/GetEntryCommentsRss?guid=ff788dca-fce2-4ad7-856d-c1a7745a2517</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
It's been a while, but we've gotten several new things into Machine.Specifications
(MSpec). I'm excited to finally release them for everyone to start playing with. You
can grab the bits <a href="http://www.assembla.com/spaces/machine/documents/aNW0n0Etir3yXNab7jnrAJ/download/mspec-0.2.zip">here</a>.
</p>
        <p>
Let's talk about what's new though. Here's an example of a new context/spec:
</p>
        <pre class="c-sharp" name="code">  [Concern("Console runner")]
  public class when_specifying_a_missing_assembly_on_the_command_line
  {
    Establish context = ()=&gt;
    {
      console = new FakeConsole();
      program = new Program(console);
    };

    Because of = ()=&gt;
      exitCode = program.Run(new string[] {missingAssemblyName});

    It should_output_an_error_message_with_the_name_of_the_missing_assembly = ()=&gt;
      console.Lines.ShouldContain(string.Format(Resources.MissingAssemblyError, 
      missingAssemblyName));

    It should_return_the_Error_exit_code = ()=&gt;
      exitCode.ShouldEqual(ExitCode.Error);

    const string missingAssemblyName = "Some.Missing.Assembly.dll";
    public static ExitCode exitCode;
    public static Program program;
    public static FakeConsole console;
  }
</pre>
        <p>
          <strong>There have been a few semantic changes</strong>
        </p>
        <ul>
          <li>
The Description attribute has been removed. There is now an optional Concern attribute
that allows you to specify a type and/or a string that the context/spec is concerned
with. 
</li>
          <li>
            <strong>Context before_each</strong> is now <strong>Establish context</strong>. 
</li>
          <li>
            <strong>Context before_all</strong> is now <strong>Establish context_once</strong>. 
</li>
          <li>
            <strong>Context after_each </strong>is now <strong>Cleanup after_each</strong>. 
</li>
          <li>
            <strong>Context after_all</strong> is now <strong>Cleanup after_each</strong>. 
</li>
          <li>
            <strong>When {...}</strong> is now <strong>Because of</strong>. This is closer to
SpecUnit.NET's verbage, and doesn't force you to specify the "when" twice. 
</li>
        </ul>
        <p>
          <strong>There is now a console runner</strong>
        </p>
        <p>
We don't quite have all the options we want yet, but the basics of the runner are
working. Here's the help from the runner:
</p>
        <img height="163" src="http://content.screencast.com/users/ajensen/folders/Jing/media/0b6d7837-d45c-4124-93f7-38bc37a7fa7b/2008-09-02_1429.png" width="588" border="0" />
        <p>
We also stole Bellware's SpecUnit.NET reporting stuff and ported it over. You can
now generate a report on your specs with the --html 
<file.html>
switch. Here's an example run:
</file.html></p>
        <img height="355" src="http://content.screencast.com/users/ajensen/folders/Jing/media/aef95516-cf4e-4df0-b428-a890624abcfe/2008-09-02_1436.png" width="588" border="0" />
        <p>
          <a href="http://blog.eleutian.com/download/mspec-0.2run.html">This is the report it
generates.</a>
        </p>
        <p>
Want to try it out?
</p>
        <ol>
          <li>
Grab the drop <a href="http://www.assembla.com/spaces/machine/documents/aNW0n0Etir3yXNab7jnrAJ/download/mspec-0.2.zip">here</a>. 
</li>
          <li>
Extract it somewhere. Put it somewhere semi-permanent because the <a href="http://testdriven.net/">TestDriven.NET</a> runner
will need a static location for the MSpec TDNet Runner. 
</li>
          <li>
If you want TestDriven.NET support, run <strong>InstallTDNetRunner.bat</strong></li>
          <li>
Check out the example in <strong>Machine.Specifications.Example</strong>. Note that
you can run with TD.NET. 
</li>
          <li>
Create a project of your own. Just add <strong>Machine.Specifications.dll</strong> and
get started. 
</li>
          <li>
Send me feedback! Leave comments, email me, <a href="http://twitter.com/aaronjensen">tweet
me</a>, whatever. 
</li>
        </ol>
        <p>
Also, this is part of <a href="http://www.assembla.com/wiki/show/machine">Machine</a>,
so feel free to take a <a href="http://svn2.assembla.com/svn/machine/trunk/">look
at the code</a> and/or submit patches. There's also a <a href="http://www.gallio.org/">Gallio</a> adapter
in there, but I didn't include it in the release as it's not quite polished enough
yet. If you're interested in it, talk to me. Special thanks to <a href="http://twitter.com/sbellware">Scott
Bellware</a>, <a href="http://blog.bits-in-motion.com/">Jeff Brown</a> and <a href="http://weblogs.asp.net/nunitaddin/default.aspx">Jamie
Cansdale</a> for their help and support. Also, extra special thanks to Eleutian's
newest dev, Jeff Olson for much of the recent work that has gone into MSpec!
</p>
        <img width="0" height="0" src="http://blog.eleutian.com/aggbug.ashx?id=ff788dca-fce2-4ad7-856d-c1a7745a2517" />
      </body>
      <title>MSpec v0.2</title>
      <guid isPermaLink="false">http://blog.eleutian.com/PermaLink,guid,ff788dca-fce2-4ad7-856d-c1a7745a2517.aspx</guid>
      <link>http://blog.eleutian.com/2008/09/02/MSpecV02.aspx</link>
      <pubDate>Tue, 02 Sep 2008 21:49:51 GMT</pubDate>
      <description>&lt;p&gt;
It's been a while, but we've gotten several new things into Machine.Specifications
(MSpec). I'm excited to finally release them for everyone to start playing with. You
can grab the bits &lt;a href="http://www.assembla.com/spaces/machine/documents/aNW0n0Etir3yXNab7jnrAJ/download/mspec-0.2.zip"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Let's talk about what's new though. Here's an example of a new context/spec:
&lt;/p&gt;
&lt;pre class="c-sharp" name="code"&gt;  [Concern("Console runner")]
  public class when_specifying_a_missing_assembly_on_the_command_line
  {
    Establish context = ()=&amp;gt;
    {
      console = new FakeConsole();
      program = new Program(console);
    };

    Because of = ()=&amp;gt;
      exitCode = program.Run(new string[] {missingAssemblyName});

    It should_output_an_error_message_with_the_name_of_the_missing_assembly = ()=&amp;gt;
      console.Lines.ShouldContain(string.Format(Resources.MissingAssemblyError, 
      missingAssemblyName));

    It should_return_the_Error_exit_code = ()=&amp;gt;
      exitCode.ShouldEqual(ExitCode.Error);

    const string missingAssemblyName = "Some.Missing.Assembly.dll";
    public static ExitCode exitCode;
    public static Program program;
    public static FakeConsole console;
  }
&lt;/pre&gt;
&lt;p&gt;
&lt;strong&gt;There have been a few semantic changes&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
The Description attribute has been removed. There is now an optional Concern attribute
that allows you to specify a type and/or a string that the context/spec is concerned
with. 
&lt;li&gt;
&lt;strong&gt;Context before_each&lt;/strong&gt; is now &lt;strong&gt;Establish context&lt;/strong&gt;. 
&lt;li&gt;
&lt;strong&gt;Context before_all&lt;/strong&gt; is now &lt;strong&gt;Establish context_once&lt;/strong&gt;. 
&lt;li&gt;
&lt;strong&gt;Context after_each &lt;/strong&gt;is now &lt;strong&gt;Cleanup after_each&lt;/strong&gt;. 
&lt;li&gt;
&lt;strong&gt;Context after_all&lt;/strong&gt; is now &lt;strong&gt;Cleanup after_each&lt;/strong&gt;. 
&lt;li&gt;
&lt;strong&gt;When {...}&lt;/strong&gt; is now &lt;strong&gt;Because of&lt;/strong&gt;. This is closer to
SpecUnit.NET's verbage, and doesn't force you to specify the "when" twice. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;There is now a console runner&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
We don't quite have all the options we want yet, but the basics of the runner are
working. Here's the help from the runner:
&lt;/p&gt;
&lt;img height="163" src="http://content.screencast.com/users/ajensen/folders/Jing/media/0b6d7837-d45c-4124-93f7-38bc37a7fa7b/2008-09-02_1429.png" width="588" border="0"&gt; 
&lt;p&gt;
We also stole Bellware's SpecUnit.NET reporting stuff and ported it over. You can
now generate a report on your specs with the --html 
&lt;file.html&gt;
switch. Here's an example run:
&lt;/p&gt;
&lt;img height="355" src="http://content.screencast.com/users/ajensen/folders/Jing/media/aef95516-cf4e-4df0-b428-a890624abcfe/2008-09-02_1436.png" width="588" border="0"&gt; 
&lt;p&gt;
&lt;a href="http://blog.eleutian.com/download/mspec-0.2run.html"&gt;This is the report it
generates.&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Want to try it out?
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Grab the drop &lt;a href="http://www.assembla.com/spaces/machine/documents/aNW0n0Etir3yXNab7jnrAJ/download/mspec-0.2.zip"&gt;here&lt;/a&gt;. 
&lt;li&gt;
Extract it somewhere. Put it somewhere semi-permanent because the &lt;a href="http://testdriven.net/"&gt;TestDriven.NET&lt;/a&gt; runner
will need a static location for the MSpec TDNet Runner. 
&lt;li&gt;
If you want TestDriven.NET support, run &lt;strong&gt;InstallTDNetRunner.bat&lt;/strong&gt; 
&lt;li&gt;
Check out the example in &lt;strong&gt;Machine.Specifications.Example&lt;/strong&gt;. Note that
you can run with TD.NET. 
&lt;li&gt;
Create a project of your own. Just add &lt;strong&gt;Machine.Specifications.dll&lt;/strong&gt; and
get started. 
&lt;li&gt;
Send me feedback! Leave comments, email me, &lt;a href="http://twitter.com/aaronjensen"&gt;tweet
me&lt;/a&gt;, whatever. 
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Also, this is part of &lt;a href="http://www.assembla.com/wiki/show/machine"&gt;Machine&lt;/a&gt;,
so feel free to take a &lt;a href="http://svn2.assembla.com/svn/machine/trunk/"&gt;look
at the code&lt;/a&gt; and/or submit patches. There's also a &lt;a href="http://www.gallio.org/"&gt;Gallio&lt;/a&gt; adapter
in there, but I didn't include it in the release as it's not quite polished enough
yet. If you're interested in it, talk to me. Special thanks to &lt;a href="http://twitter.com/sbellware"&gt;Scott
Bellware&lt;/a&gt;, &lt;a href="http://blog.bits-in-motion.com/"&gt;Jeff Brown&lt;/a&gt; and &lt;a href="http://weblogs.asp.net/nunitaddin/default.aspx"&gt;Jamie
Cansdale&lt;/a&gt; for their help and support. Also, extra special thanks to Eleutian's
newest dev, Jeff Olson for much of the recent work that has gone into MSpec!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eleutian.com/aggbug.ashx?id=ff788dca-fce2-4ad7-856d-c1a7745a2517" /&gt;</description>
      <comments>http://blog.eleutian.com/CommentView,guid,ff788dca-fce2-4ad7-856d-c1a7745a2517.aspx</comments>
      <category>bdd</category>
      <category>frameworks</category>
    </item>
    <item>
      <trackback:ping>http://blog.eleutian.com/Trackback.aspx?guid=2bacd3f9-be27-4029-87e9-1f8111a1145b</trackback:ping>
      <pingback:server>http://blog.eleutian.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eleutian.com/PermaLink,guid,2bacd3f9-be27-4029-87e9-1f8111a1145b.aspx</pingback:target>
      <dc:creator>Aaron</dc:creator>
      <wfw:comment>http://blog.eleutian.com/CommentView,guid,2bacd3f9-be27-4029-87e9-1f8111a1145b.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eleutian.com/SyndicationService.asmx/GetEntryCommentsRss?guid=2bacd3f9-be27-4029-87e9-1f8111a1145b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Mikel Lindsaar recently <a href="http://www.lindsaar.net/2008/6/24/tip-24-being-clever-in-specs-is-for-dummies">posted
a tip</a> encouraging rSpec users to not use before :each, and set up the context
in every "it" specification. 
</p>
        <p>
I'm afraid I disagree. By pushing context setup into your specifications, you're
allowing your contexts to become artificial and anemic and your specifications to
become fat and more than just specifications. 
<br /><br />
Ultimately, this means that your reports will read poorly and it will be easy to introduce
specifications in a context that do not match the others.<br /><br />
Mikel arrives at the following specs at the end of his post: 
</p>
        <pre name="code" class="ruby">describe "when not logged in" do
  it "should redirect if we are not logged in" do
    get :index
    response.should redirect_to login_path
  end
end

describe "when logged in" do
  def given_a_logged_in_user
    session[:logged_in] = true
    session[:user_id] = 99
  end

  it "should let be a success" do
    given_a_logged_in_user
    get :index
    response.should be_success
  end

  it "should render the index template" do
    given_a_logged_in_user
    get :index
    response.should render_template('people/index')
  end
end</pre>
"when logged in" is not what I would consider a valid description of Mikel's
context in these specs. I would call it something along the lines of "when visiting
the index page while logged in". *That* is the context you are specifying against.
Compare:<br /><br />
when logged in, it should render the index template<br /><br />
vs.<br /><br />
when visiting the index page while logged in, it should render the index template<br /><br />
The first is clearly missing something. Unless rendering the index template is a direct
result of just *being* logged in, the spec is flawed.<br /><br />
With that in mind, as soon as you describe your context, there's no reason to
not pull that context setup into a single before method. It forces you to use that
context in every specification contained within your describe. It also makes your
tests easier to read. You establish your context, and then you make one line specifications
against that context. 
<br /><br />
I do agree that DRY should not be taken too far in tests. Base classes, helper methods,
all that sort of thing can quickly obfuscate them, but do not forsake the context
setup. <img width="0" height="0" src="http://blog.eleutian.com/aggbug.ashx?id=2bacd3f9-be27-4029-87e9-1f8111a1145b" /></body>
      <title>Don't take RY (Repeat Yourself) in specs too far</title>
      <guid isPermaLink="false">http://blog.eleutian.com/PermaLink,guid,2bacd3f9-be27-4029-87e9-1f8111a1145b.aspx</guid>
      <link>http://blog.eleutian.com/2008/07/02/DontTakeRYRepeatYourselfInSpecsTooFar.aspx</link>
      <pubDate>Wed, 02 Jul 2008 03:04:07 GMT</pubDate>
      <description>&lt;p&gt;
Mikel Lindsaar recently &lt;a href="http://www.lindsaar.net/2008/6/24/tip-24-being-clever-in-specs-is-for-dummies"&gt;posted
a tip&lt;/a&gt; encouraging rSpec users to not use before :each, and set up the context
in every &amp;quot;it&amp;quot; specification. 
&lt;/p&gt;
&lt;p&gt;
I&amp;#39;m afraid I disagree. By pushing context setup into your specifications, you&amp;#39;re
allowing your contexts to become artificial and anemic and your specifications to
become fat and more than just specifications. 
&lt;br /&gt;
&lt;br /&gt;
Ultimately, this means that your reports will read poorly and it will be easy to introduce
specifications in a context that do not match the others.&lt;br /&gt;
&lt;br /&gt;
Mikel arrives at the following specs at the end of his post: 
&lt;/p&gt;
&lt;pre name="code" class="ruby"&gt;describe &amp;quot;when not logged in&amp;quot; do
  it &amp;quot;should redirect if we are not logged in&amp;quot; do
    get :index
    response.should redirect_to login_path
  end
end

describe &amp;quot;when logged in&amp;quot; do
  def given_a_logged_in_user
    session[:logged_in] = true
    session[:user_id] = 99
  end

  it &amp;quot;should let be a success&amp;quot; do
    given_a_logged_in_user
    get :index
    response.should be_success
  end

  it &amp;quot;should render the index template&amp;quot; do
    given_a_logged_in_user
    get :index
    response.should render_template(&amp;#39;people/index&amp;#39;)
  end
end&lt;/pre&gt;
&amp;quot;when logged in&amp;quot; is not what I would consider a valid description of Mikel&amp;#39;s
context in these specs. I would call it something along the lines of &amp;quot;when visiting
the index page while logged in&amp;quot;. *That* is the context you are specifying against.
Compare:&lt;br /&gt;
&lt;br /&gt;
when logged in, it should render the index template&lt;br /&gt;
&lt;br /&gt;
vs.&lt;br /&gt;
&lt;br /&gt;
when visiting the index page while logged in, it should render the index template&lt;br /&gt;
&lt;br /&gt;
The first is clearly missing something. Unless rendering the index template is a direct
result of just *being* logged in, the spec is flawed.&lt;br /&gt;
&lt;br /&gt;
With that in mind, as soon as you describe your context, there&amp;#39;s no reason to
not pull that context setup into a single before method. It forces you to use that
context in every specification contained within your describe. It also makes your
tests easier to read. You establish your context, and then you make one line specifications
against that context. 
&lt;br /&gt;
&lt;br /&gt;
I do agree that DRY should not be taken too far in tests. Base classes, helper methods,
all that sort of thing can quickly obfuscate them, but do not forsake the context
setup. &lt;img width="0" height="0" src="http://blog.eleutian.com/aggbug.ashx?id=2bacd3f9-be27-4029-87e9-1f8111a1145b" /&gt;</description>
      <comments>http://blog.eleutian.com/CommentView,guid,2bacd3f9-be27-4029-87e9-1f8111a1145b.aspx</comments>
      <category>bdd</category>
      <category>rspec</category>
      <category>dry</category>
    </item>
  </channel>
</rss>