Submitted error #15608.<br><br><br><br><div class="gmail_quote">On Nov 13, 2007 12:16 PM, David Chelimsky &lt;<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Nov 13, 2007 11:05 AM, sinclair bain &lt;<a href="mailto:rspec.user@gmail.com">rspec.user@gmail.com</a>&gt; wrote:<br>&gt; VERSION: rspec rails plugin current edge version<br>&gt; XP/Cygwin on XP
<br>&gt;<br>&gt; Hi,<br>&gt; I hit this when trying to use parenthesis in my stories ... (that&#39;ll teach<br>&gt; me!).<br>&gt;<br>&gt; If a scenario looks &nbsp;like the following:<br>&gt;<br>&gt; &nbsp;Story &quot;User has story with parentheses&quot;, %{
<br>&gt; &nbsp; As a user<br>&gt; &nbsp; I want parenthesis<br>&gt; &nbsp; So that ... well I just do<br>&gt; }, :type =&gt; RailsStory do<br>&gt;<br>&gt; &nbsp; Scenario &quot;the Given has parentheses&quot; do<br>&gt; &nbsp; &nbsp; &nbsp;Given &quot;parenthesis () in the given &quot; do
<br>&gt; &nbsp; &nbsp; end<br>&gt;<br>&gt; &nbsp; &nbsp; When &quot;anything&quot; do<br>&gt; &nbsp; &nbsp; end<br>&gt;<br>&gt; &nbsp; &nbsp; Then &quot;The error occurred while evaluating nil.perform &quot; do<br>&gt; &nbsp; &nbsp; end<br>&gt;<br>&gt; &nbsp; end<br>&gt; end<br>
&gt;<br>&gt; This fails with the following:<br>&gt;<br>&gt; The error occurred while evaluating nil.perform<br>&gt;<br>&gt; /cygdrive/c/development/sandbox/prototypes/proj/config/../vendor/plugins/rspec/lib/spec/story/world.rb:
<br>&gt; 60:in `store_and_call&#39;<br>&gt; /cygdrive/c/development/sandbox/prototypes/proj/config/../vendor/plugins/rspec/lib/spec/story/world.rb:<br>&gt; 92:in `Given&#39;<br>&gt; stories/parenthesis_error_story.rb:10<br>
&gt;<br>&gt;<br>&gt; Looks like the problem is in the Step#matches? method<br>&gt; since<br>&gt; &nbsp; &nbsp; &quot;abc (re) def&quot;.match /abc (re) def/<br>&gt; returns nil<br>&gt; however<br>&gt; &nbsp; &nbsp; &quot;abc (re) def&quot;.match /abc \(re\) def/
<br>&gt; returns the match<br>&gt;<br>&gt; The Step#assign_expression method when modifed as follows<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; def assign_expression(name)<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; expression = name.dup<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if String === expression
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while expression =~ /(\$\w*)/<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; expression.gsub!($1, &quot;(.*)&quot;)<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; expression.gsub! &#39;(&#39;, &#39;\(&#39; &nbsp; &nbsp; # here<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; expression.gsub! &#39;)&#39;, &#39;\)&#39; &nbsp; &nbsp; # here<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @expression = Regexp.new (&quot;^#{expression}$&quot;)<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; end<br>&gt;<br>&gt; Then the specs pass.
<br>&gt;<br>&gt; This has been here for a couple of weeks just got round to debugging.<br><br></div></div>Please do not use this list for patches if you expect them to be incorporated.<br><br><a href="http://rspec.rubyforge.org/community/contribute.html" target="_blank">
http://rspec.rubyforge.org/community/contribute.html</a><br><a href="http://rubyforge.org/tracker/?group_id=797" target="_blank">http://rubyforge.org/tracker/?group_id=797</a><br><br>Cheers,<br>David<br>_______________________________________________
<br>rspec-users mailing list<br><a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users
</a><br></blockquote></div><br><br clear="all"><br>-- <br><br><br>Cheers!<br>sinclair