Skip to content


In response to those at Thoughbot who don’t get RSpec

Earlier today, while going through my newsfeeds, I stumbled upon this gem. I ranted in my comment, and decided to post it again here.


It always seems to come back to the same thing, “I don’t get it, so it must not be any good.” With all new and different ideas come controversy which is a good thing, because it forces people to provide critical evaluation which we all benefit from.

<p><span class="caps">BDD</span> is nothing new.  Lots of people have been doing it for a while without really knowing they were doing it.  Or maybe they knew and they didn&#8217;t choose to call it <span class="caps">BDD</span>.  There isn&#8217;t even enough information on the behavioral development website to demonstrate why you should or shouldn&#8217;t be using it.</p>


<p>Rspec is a different syntax.  I don&#8217;t buy into it being hard to learn as it was designed to be easy to pickup.  In reality, writing specs is what I have been doing in xUnit for years before I had even heard of Rspec.  If you could <strong>write</strong> <a href="http://thoughtbot.com/projects/shoulda">Shoulda</a>, you should be able to at least understand Rspec.</p>


<p>As to what Jon Yurek posted:</p>


<blockquote>
    <p> I think Story Runner is a horrible idea: English is not a programming language, and tests and specs are still programming.</p>
</blockquote>


<p>I agree that English is not a <em>programming</em> language in the traditional sense, but you can use English to create a list of actions that everyone can understand, and this is why I like the stories. They are the easily understanable goals of my website or application.  I use them to communicate with the owner of the application and tighten that feeback loop.  My goal as a lazy developer is communicate my actions as simply as possible so that they are understood.  I&#8217;m not into black magic development, and the stories allow me to consistently demonstrate functionality in an easy to understand fashion.</p>


<p>I always ask developers why they are writing the code they are currently working on?  If you can articulate the reason, why not put it in a spec?  And next time they start writing code, you could save yourself some time by putting it a spec yourself.  With stories you are just abstracting it to a higher level.  You write stories to describe functionality, and your lower level specs just describe your implementation of that functionality.</p>


<p>So, what do you think?  Why am I wrong for thinking RSpec is a good idea?  Why am I wasting my time with RSpec stories?  I challenge someone more enlightened than me to show me what I am missing.</p>


<p>PS.  I&#8217;m giving a talk on this exact subject at <a href="http://www.actsasconference.com/speakers/bryan-liles">Acts as Conference</a> next month down in Florida.</p>

Posted in Uncategorized.