VERSION: rspec rails plugin current edge version<br>XP/Cygwin on XP<br><br>Hi,<br>I hit this when trying to use parenthesis in my stories ... (that&#39;ll teach me!).<br><br>If a scenario looks&nbsp; like the following:<br><br>
Story &quot;User has story with parentheses&quot;, %{<br>&nbsp; As a user<br>&nbsp; I want parenthesis<br>&nbsp; So that ... well I just do&nbsp; <br>}, :type =&gt; RailsStory do<br><br>&nbsp; Scenario &quot;the Given has parentheses&quot; do<br>
&nbsp;&nbsp;&nbsp; Given &quot;parenthesis () in the given &quot; do<br>&nbsp;&nbsp;&nbsp; end<br><br>&nbsp;&nbsp;&nbsp; When &quot;anything&quot; do<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Then &quot;The error occurred while evaluating nil.perform &quot; do<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp;<br>&nbsp; end
<br>end<br clear="all"><br>This fails with the following:<br><br>The error occurred while evaluating nil.perform<br>&nbsp; /cygdrive/c/development/sandbox/prototypes/proj/config/../vendor/plugins/rspec/lib/spec/story/world.rb: 60:in `store_and_call&#39;
<br>/cygdrive/c/development/sandbox/prototypes/proj/config/../vendor/plugins/rspec/lib/spec/story/world.rb: 92:in `Given&#39;<br>stories/parenthesis_error_story.rb:10<br><br><br>Looks like the problem is in the Step#matches? method
<br>since <br>&nbsp;&nbsp;&nbsp; &quot;abc (re) def&quot;.match /abc (re) def/ <br>returns nil<br>however <br>&nbsp;&nbsp;&nbsp; &quot;abc (re) def&quot;.match /abc \(re\) def/<br>returns the match<br><br>The Step#assign_expression method when modifed as follows
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def assign_expression(name)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expression = name.dup<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if String === expression<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while expression =~ /(\$\w*)/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expression.gsub!($1, &quot;(.*)&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expression.gsub! &#39;(&#39;, &#39;\(&#39;&nbsp;&nbsp;&nbsp;&nbsp; # here<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expression.gsub! &#39;)&#39;, &#39;\)&#39;&nbsp;&nbsp;&nbsp;&nbsp; # here<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @expression = Regexp.new
(&quot;^#{expression}$&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br><br>Then the specs pass.<br><br>This has been here for a couple of weeks just got round to debugging.<br><br>HTH<br>heers!<br>sinclair