<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>David Chelimsky: Tag rbehave</title>
    <link>http://blog.davidchelimsky.net/articles/tag/rbehave?tag=rbehave</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>on software in process and practice</description>
    <item>
      <title>pending(&amp;quot;insert reason here&amp;quot;)</title>
      <description>&lt;p&gt;In RSpec-1.0, we introduced a Not Yet Implemented feature. When you say &amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;it "should do something"&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;... with no block, the summary report lists that example as not implemented.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;37 examples, 0 failures, 1 not implemented&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;As I started to use this I found myself doing stuff like this:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;it "should do something" 
# do
#   here.is(the).actual(implementation).but(commented).out
# end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This made me sad. I hate having things that are commented out like that, even if the summary report draws my attention to it.&lt;/p&gt;


	&lt;p&gt;Then came a conversation with &lt;a href="http://dannorth.net"&gt;Dan&lt;/a&gt; about &lt;a href="http://rbehave.rubyforge.org"&gt;rbehave&lt;/a&gt;. In his article &lt;a href="http://dannorth.net/2007/06/introducing-rbehave"&gt;introducing rbehave&lt;/a&gt;, Dan talks about identifying pending scenarios so instead of getting failures while he&amp;#8217;s working on the objects that must implement the behaviour, he gets a nice list of scenarios that should pass pending the completion of those objects. We discussed the similarities and differences between the Not Yet Implemented feature in RSpec and the Pending feature in rbehave and agreed that RSpec should have the pending method.&lt;/p&gt;


	&lt;p&gt;And so it has come to pass.&lt;/p&gt;


	&lt;p&gt;RSpec (trunk, as of rev 2118 &amp;#8211; will be included in 1.0.6) still supports calling #it with no block, but now also supports the #pending method, allowing you to say:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;describe "pending example (using pending method)" do
  it %Q|should be reported as "PENDING: for some reason"| do
    pending("for some reason")
  end
end

describe "pending example (with no block)" do
  it %Q|should be reported as "PENDING: Not Yet Implemented"|
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;And hear:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ ruby bin/spec examples/pending_example.rb -fs

pending example (using pending method)
- should be reported as "PENDING: for some reason" (PENDING: for some reason)

pending example (with no block)
- should be reported as "PENDING: Not Yet Implemented" (PENDING: Not Yet Implemented)

Finished in 0.006639 seconds

2 examples, 0 failures, 2 pending
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The #pending method raises a Spec::DSL::ExamplePendingError, which gets reported, in this case, as &amp;#8220;PENDING: for some reason&amp;#8221;. If you leave off the block the example will be reported as &amp;#8220;PENDING: Not Yet Implemented&amp;#8221;. Either way, the summary will combine these two types of pending examples as just &amp;#8220;pending&amp;#8221;.&lt;/p&gt;</description>
      <pubDate>Sat, 23 Jun 2007 13:04:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:11bccf15-f5a9-45b1-8014-2ec39fb1413b</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2007/06/23/pending-insert-reason-here</link>
      <category>rspec</category>
      <category>rbehave</category>
    </item>
    <item>
      <title>Describe it with RSpec</title>
      <description>&lt;pre&gt;&lt;code&gt;module BddTools
  describe RSpec do
    it "should help you get the words right" do
      Kernel.should respond_to(:describe)
      Behaviour.should respond_to(:it)
    end
  end
end&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;That code produces this output:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;BddTools::RSpec
- should help you get the words right
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Behaviour Driven Development is all about &lt;a href="http://behaviour-driven.org/GettingTheWordsRight"&gt;getting the words right&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://dannorth.net"&gt;Dan North&lt;/a&gt; has just registered &lt;a href="http://rbehave.rubyforge.org"&gt;rbehave&lt;/a&gt; at &lt;a href="http://rubyforge.org"&gt;rubyforge&lt;/a&gt; and is using &lt;a href="http://rspec.rubyforge.org"&gt;rspec&lt;/a&gt; to drive &lt;span class="caps"&gt;ITS&lt;/span&gt; behaviour. Getting started, he felt that &amp;#8220;context&amp;#8221; and &amp;#8220;specify&amp;#8221; weren&amp;#8217;t speaking to him, so he wrapped them in &amp;#8220;describe&amp;#8221; and &amp;#8220;it&amp;#8221; to create the syntax in the example above.&lt;/p&gt;


	&lt;p&gt;These new words have been added to rspec&amp;#8217;s trunk and will be released with rspec-0.8.3. Combined with their elder siblings &amp;#8220;context&amp;#8221; and &amp;#8220;specify&amp;#8221;, you&amp;#8217;ll now be able to choose from a wider set of words to get your specs to &amp;#8220;speak&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;Keep your eyes peeled for &lt;a href="http://rbehave.rubyforge.org"&gt;rbehave&lt;/a&gt;, an Acceptance Testing Framework that provides a Story Runner designed to promote communication between Customers, Developers and Testers. Combine rbehave&amp;#8217;s Story Runner with rspec describing lower level behaviours and you&amp;#8217;ll have the beginnings of the perfect toolset for a &lt;span class="caps"&gt;BDD&lt;/span&gt; project in Ruby.&lt;/p&gt;</description>
      <pubDate>Sun, 11 Mar 2007 00:10:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:ede08d8f-301c-4c55-bf4d-6048f76f34c8</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2007/03/11/describe-it-with-rspec</link>
      <category>bdd</category>
      <category>rspec</category>
      <category>rbehave</category>
      <trackback:ping>http://blog.davidchelimsky.net/articles/trackback/61</trackback:ping>
    </item>
  </channel>
</rss>
