<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Peter's Blog - Nodes for rspec</title>
    <link>http://www.petersblog.org/</link>
    <description>Nodes containing the tag rspec</description>
    <item>
      <title>Netbeans and Cygwin Ruby</title>
      <link>http://www.petersblog.org/node/view/1631</link>
      <description>&lt;p&gt;
&lt;a href="/tag/netbeans"&gt;Netbeans&lt;/a&gt; and &lt;a href="/tag/cygwin"&gt;cygwin&lt;/a&gt; &lt;a href="/tag/ruby"&gt;ruby&lt;/a&gt; don't have a happy relationship. To use the cygwin ruby interpreter it is necessary to launch Netbeans (6.1) with the arguments: 
&lt;/p&gt;
&lt;div class="verbatim-block"&gt;&lt;pre&gt;-J-Druby.no.sync-stdio=true
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
as otherwise Netbeans will pass a windows-style file name to the cygwin ruby that the latter cannot recognise (C:\Projects\Blah instead of /cygdrive/c/Projects/Blah). Unfortunately the ruby interpreter configuration in Netbeans tries to be clever and insists you point it to a ruby executable, you can't give it a batch file that will hack things into working shape. 
&lt;/p&gt;
&lt;p&gt;
rspec on cygwin has some similar problems. Here are some hacks to the rspec plugin to make it work from netbeans: 
&lt;/p&gt;
&lt;p&gt;
In vendor/plugins/rspec/bin/bin, change: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;&lt;span class="Variable"&gt;&lt;span class="Variable"&gt;$&lt;/span&gt;LOAD_PATH&lt;/span&gt;.&lt;span class="Entity"&gt;unshift&lt;/span&gt;(&lt;span class="Support"&gt;File&lt;/span&gt;.&lt;span class="Entity"&gt;expand_path&lt;/span&gt;(&lt;span class="Support"&gt;File&lt;/span&gt;.&lt;span class="Entity"&gt;dirname&lt;/span&gt;(&lt;span class="Variable"&gt;__FILE__&lt;/span&gt;) &lt;span class="Keyword"&gt;+&lt;/span&gt; &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;/../lib&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;))
&lt;/pre&gt;
&lt;p&gt;
to 
&lt;/p&gt;
&lt;pre class="lazy"&gt;&lt;span class="Variable"&gt;&lt;span class="Variable"&gt;$&lt;/span&gt;LOAD_PATH&lt;/span&gt;.&lt;span class="Entity"&gt;unshift&lt;/span&gt;(&lt;span class="Support"&gt;File&lt;/span&gt;.&lt;span class="Entity"&gt;dirname&lt;/span&gt;(&lt;span class="Variable"&gt;__FILE__&lt;/span&gt;).&lt;span class="Entity"&gt;sub&lt;/span&gt;( &lt;span class="String"&gt;&lt;span class="String"&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class="String"&gt;C:&lt;span class="Constant"&gt;\/&lt;/span&gt;&lt;/span&gt;&lt;span class="String"&gt;&lt;span class="String"&gt;/&lt;/span&gt;&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;/cygdrive/c/&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;) &lt;span class="Keyword"&gt;+&lt;/span&gt; &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;/../lib&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)
&lt;/pre&gt;
&lt;p&gt;
In vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb, change: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;load file
&lt;/pre&gt;
&lt;p&gt;
to 
&lt;/p&gt;
&lt;pre class="lazy"&gt;load &lt;span class="Support"&gt;File&lt;/span&gt;.&lt;span class="Entity"&gt;expand_path&lt;/span&gt;(file).&lt;span class="Entity"&gt;gsub&lt;/span&gt;(&lt;span class="String"&gt;&lt;span class="String"&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class="String"&gt;C:&lt;/span&gt;&lt;span class="String"&gt;&lt;span class="String"&gt;/&lt;/span&gt;&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;/cygdrive/c&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;/pre&gt;
&lt;p&gt;
Tip: to diagnose problems with 'require' not finding files, put this: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;p &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;$&lt;/span&gt;:&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;
before the failing line to see what directories are in the load path. If you see 'C:\' and it's cygwin then fix it. 
&lt;/p&gt;
&lt;p&gt;
Unfortunately it takes a good 20 seconds for cygwin/rspec to run a trivial test script. The rspec server starts and runs but netbeans/rspec seem reluctant to use it (it runs tests ok from the command line). 
&lt;/p&gt;
&lt;p&gt;
Why am I still bothering with cygwin? Because I still want to test gcc C code by compiling it into ruby extensions and using ruby test codes (rspec or unit testing). 
&lt;/p&gt;
&lt;p&gt;
In tracing these problems I came across more reasons that Netbeans is worth the hassle: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
ctrl-tab to switch to last open tab. ctrl and hold tab brings up a handy little context menu to choose a tab from (kinda like windows task switching with tab). 
&lt;/li&gt;
&lt;li&gt;
press ctrl and mouse over an identifier to bring up rdoc info about it. Ctrl-click to go to it's definition. 
&lt;/li&gt;
&lt;li&gt;
alt-b to go back to where you came from. 
&lt;/li&gt;
&lt;li&gt;
click on an 'end' and the matching begin/do/if is highlighted and vice versa, which is damn useful. 
&lt;/li&gt;
&lt;li&gt;
select an identifier and all matching identifiers in your file are automatically highlighted. 
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Related Posts: &lt;a href="/tag/cygwin"&gt;cygwin&lt;/a&gt; &lt;a href="/tag/netbeans"&gt;netbeans&lt;/a&gt; &lt;a href="/tag/rspec"&gt;rspec&lt;/a&gt; &lt;a href="/tag/ruby"&gt;ruby&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1631</guid>
      <category domain="http://www.technorati.com/tag">cygwin</category>
      <category domain="http://www.technorati.com/tag">netbeans</category>
      <category domain="http://www.technorati.com/tag">rspec</category>
      <category domain="http://www.technorati.com/tag">ruby</category>
    </item>
    <item>
      <title>rspec</title>
      <link>http://www.petersblog.org/node/view/1630</link>
      <description>&lt;p&gt;
I've been trying out &lt;a href="http://rspec.info/"&gt;rspec&lt;/a&gt;, a new testing framework for &lt;a href="/tag/ruby"&gt;ruby&lt;/a&gt; that allows one to better follow the principles of Behaviour Driven Design (BDD). BDD is a step on from Test Driven Design (TDD) approach exemplified in the standard ruby unit test framework. TDD is the process of starting ones development by writing the tests that your new module should pass. As you write each test you then implement the code to pass it and hence, voila, you have nicely designed and robust software. In BDD you approach testing the code from how it is supposed to behave. When liasing with clients this is a better approach as everyone can talk in the same language, essentially in terms of requirements so one can try to get less bogged down in implementation details. 
&lt;/p&gt;
&lt;p&gt;
Here are some rspec tests for a class I have been working on: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; describe &lt;span class="Variable"&gt;ReportHelper&lt;/span&gt; &lt;span class="Keyword"&gt;do&lt;/span&gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt;   &lt;span class="Entity"&gt;before&lt;/span&gt;(&lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;each&lt;/span&gt;) &lt;span class="Keyword"&gt;do&lt;/span&gt;
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; &lt;span class="Comment"&gt;    &lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt; &lt;span class="Comment"&gt;    &lt;span class="Comment"&gt;#&lt;/span&gt; Create a new clean Report class for each individual test&lt;/span&gt;
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt; &lt;span class="Comment"&gt;    &lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt; &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="Support"&gt;ReportHelper&lt;/span&gt;::&lt;span class="Entity"&gt;Report&lt;/span&gt;.&lt;span class="Entity"&gt;new&lt;/span&gt;
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt;   &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   9 &lt;/span&gt;   it &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;should allow a column to be added&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="Keyword"&gt;do&lt;/span&gt;
&lt;span class="line-numbers"&gt;  10 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddColumn&lt;/span&gt;( &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;First Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  11 &lt;/span&gt;   &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;  12 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  13 &lt;/span&gt;   it &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;should allow multiple columns to be added&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="Keyword"&gt;do&lt;/span&gt;
&lt;span class="line-numbers"&gt;  14 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddColumn&lt;/span&gt;( &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;First Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  15 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddColumn&lt;/span&gt;( &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;Second Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  16 &lt;/span&gt;   &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;  17 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  18 &lt;/span&gt;   it &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;should allow rows to be added to the report&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="Keyword"&gt;do&lt;/span&gt;
&lt;span class="line-numbers"&gt;  19 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddColumn&lt;/span&gt;( &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;First Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  20 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddColumn&lt;/span&gt;( &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;Second Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  21 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddRow&lt;/span&gt; &lt;span class="Keyword"&gt;do&lt;/span&gt;
&lt;span class="line-numbers"&gt;  22 &lt;/span&gt; &lt;span class="Comment"&gt;      &lt;span class="Comment"&gt;#&lt;/span&gt; pass&lt;/span&gt;
&lt;span class="line-numbers"&gt;  23 &lt;/span&gt;     &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;  24 &lt;/span&gt;   &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;  25 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  26 &lt;/span&gt;   it &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;should only allow rows to be added if columns exist&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="Keyword"&gt;do&lt;/span&gt;
&lt;span class="line-numbers"&gt;  27 &lt;/span&gt;     lambda{ &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddRow&lt;/span&gt;}.&lt;span class="Entity"&gt;should&lt;/span&gt; &lt;span class="Entity"&gt;raise_error&lt;/span&gt;(&lt;span class="Variable"&gt;RuntimeError&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;No columns defined&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  28 &lt;/span&gt;   &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;  29 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  30 &lt;/span&gt;   it &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;should return simple cell values&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="Keyword"&gt;do&lt;/span&gt;
&lt;span class="line-numbers"&gt;  31 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddColumn&lt;/span&gt;( &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;First Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  32 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddColumn&lt;/span&gt;( &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;Second Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  33 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  34 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddRow&lt;/span&gt; &lt;span class="Keyword"&gt;do &lt;/span&gt;|&lt;span class="Variable"&gt;oRow&lt;/span&gt;|
&lt;span class="line-numbers"&gt;  35 &lt;/span&gt;       oRow[ &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;First Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;] &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="Constant"&gt;98&lt;/span&gt;
&lt;span class="line-numbers"&gt;  36 &lt;/span&gt;       oRow[ &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;Second Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;] &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="Constant"&gt;198&lt;/span&gt;
&lt;span class="line-numbers"&gt;  37 &lt;/span&gt;     &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;  38 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  39 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;[&lt;span class="Constant"&gt;0&lt;/span&gt;][&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;First Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;].&lt;span class="Entity"&gt;should&lt;/span&gt; &lt;span class="Keyword"&gt;==&lt;/span&gt; &lt;span class="Constant"&gt;98&lt;/span&gt;
&lt;span class="line-numbers"&gt;  40 &lt;/span&gt;     &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;[&lt;span class="Constant"&gt;0&lt;/span&gt;][&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;Second Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;].&lt;span class="Entity"&gt;should&lt;/span&gt; &lt;span class="Keyword"&gt;==&lt;/span&gt; &lt;span class="Constant"&gt;198&lt;/span&gt;
&lt;span class="line-numbers"&gt;  41 &lt;/span&gt;   &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;  42 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  43 &lt;/span&gt; &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;
Each test has a descriptive string that can be interpreted in two ways: as a test that must be passed or as a requirement for the software. The rspec toolset includes something that will pull out all these strings and give a summary of what testing has been done/what the requirements for the software are. If an auditor asks how the software is tested, bang, there is a full report of the tests. At a practical level (i.e. makes life easier for me) I prefer this to the ruby unit test system where one has to think up meaningful_method_names for each test. The strings are easier to write and read and reduce the need for comments. 
&lt;/p&gt;
&lt;p&gt;
Example report: 
&lt;/p&gt;
&lt;div class="verbatim-block"&gt;&lt;pre&gt;ReportHelper

- should allow a column to be added
- should allow multiple columns to be added
- should allow rows to be added to the report
- should only allow rows to be added if columns exist
- should return simple cell values
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
Rspec contains sweeter syntactic sugar than the ruby unit test module. For example, rspec overloads every object in the system with a 'should' method for doing the equivalent of assert tests: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;    &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;[&lt;span class="Constant"&gt;0&lt;/span&gt;][&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;First Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;].&lt;span class="Entity"&gt;should&lt;/span&gt; &lt;span class="Keyword"&gt;==&lt;/span&gt; &lt;span class="Constant"&gt;98&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;
Compare this to test/unit: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;    assert_equal &lt;span class="Constant"&gt;98&lt;/span&gt;, &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;[&lt;span class="Constant"&gt;0&lt;/span&gt;][&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;First Column&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;]
&lt;/pre&gt;
&lt;p&gt;
apart from more typing, assert_equal has the expectation/actual things in what is intuitively to me the wrong order and I'm always having to correct these lines because the error messages have the terms swapped. 
&lt;/p&gt;
&lt;p&gt;
Rspec can test assertions more cleanly: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;    lambda{ &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddRow&lt;/span&gt;}.&lt;span class="Entity"&gt;should&lt;/span&gt; &lt;span class="Entity"&gt;raise_error&lt;/span&gt;(&lt;span class="Variable"&gt;RuntimeError&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;No columns defined&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;/pre&gt;
&lt;p&gt;
although it's a pity that the lambda is necessary (and probably no 1 noob trap) but with test/unit the following always seemed like a lot of typing: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;    oError &lt;span class="Keyword"&gt;=&lt;/span&gt; assert_raises &lt;span class="Variable"&gt;RuntimeError&lt;/span&gt; &lt;span class="Keyword"&gt;do&lt;/span&gt;
      &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;@&lt;/span&gt;oReport&lt;/span&gt;.&lt;span class="Entity"&gt;AddRow&lt;/span&gt;
    &lt;span class="Keyword"&gt;end&lt;/span&gt;
    assert_equal &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;No columns defined&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;, oError.&lt;span class="Entity"&gt;message&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;
rspec is nicely integrated into &lt;a href="/tag/rails"&gt;rails&lt;/a&gt;, plugins being available to generate rspec tested controllers and models and suchlike, rake tasks to generate documents (woohoo) etc. It is integrated into &lt;a href="/tag/netbeans"&gt;netbeans&lt;/a&gt; and runs ok on Windows although when the tests are run (CTRL-F6) there is a tedious few seconds wasted in startup time. It is possible to run an rspec server in the background to eliminate this startup but it doesn't work on windows native ruby, it gives an error lamenting Microsofts glorious omission of a fork api. 
&lt;/p&gt;
&lt;p&gt;
There is much more to Rspec than this. One aim seems to be to write psuedo testing languages and have clients use these to write stories about what the software will do, these stories turning into a test framework. As the slashdot tag goes, 'goodluckwiththat'. At a practical level, I'm liking rspec even if only as a unit test framework with added syntactic sugar. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/netbeans"&gt;netbeans&lt;/a&gt; &lt;a href="/tag/rails"&gt;rails&lt;/a&gt; &lt;a href="/tag/rspec"&gt;rspec&lt;/a&gt; &lt;a href="/tag/ruby"&gt;ruby&lt;/a&gt; &lt;a href="/tag/testing"&gt;testing&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1630</guid>
      <category domain="http://www.technorati.com/tag">netbeans</category>
      <category domain="http://www.technorati.com/tag">rails</category>
      <category domain="http://www.technorati.com/tag">rspec</category>
      <category domain="http://www.technorati.com/tag">ruby</category>
      <category domain="http://www.technorati.com/tag">testing</category>
    </item>
  </channel>
</rss>
