Submitted error #15608.<br><br><br><br><div class="gmail_quote">On Nov 13, 2007 12:16 PM, David Chelimsky <<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>> 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 <<a href="mailto:rspec.user@gmail.com">rspec.user@gmail.com</a>> wrote:<br>> 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'll teach<br>> me!).<br>><br>> If a scenario looks like the following:<br>><br>> Story "User has story with parentheses", %{
<br>> As a user<br>> I want parenthesis<br>> So that ... well I just do<br>> }, :type => RailsStory do<br>><br>> Scenario "the Given has parentheses" do<br>> Given "parenthesis () in the given " do
<br>> end<br>><br>> When "anything" do<br>> end<br>><br>> Then "The error occurred while evaluating nil.perform " do<br>> end<br>><br>> end<br>> end<br>
><br>> This fails with the following:<br>><br>> The error occurred while evaluating nil.perform<br>><br>> /cygdrive/c/development/sandbox/prototypes/proj/config/../vendor/plugins/rspec/lib/spec/story/world.rb:
<br>> 60:in `store_and_call'<br>> /cygdrive/c/development/sandbox/prototypes/proj/config/../vendor/plugins/rspec/lib/spec/story/world.rb:<br>> 92:in `Given'<br>> stories/parenthesis_error_story.rb:10<br>
><br>><br>> Looks like the problem is in the Step#matches? method<br>> since<br>> "abc (re) def".match /abc (re) def/<br>> returns nil<br>> however<br>> "abc (re) def".match /abc \(re\) def/
<br>> returns the match<br>><br>> The Step#assign_expression method when modifed as follows<br>><br>> def assign_expression(name)<br>> expression = name.dup<br>> if String === expression
<br>> while expression =~ /(\$\w*)/<br>> expression.gsub!($1, "(.*)")<br>> end<br>><br>> expression.gsub! '(', '\(' # here<br>
> expression.gsub! ')', '\)' # here<br>><br>> end<br>> @expression = Regexp.new ("^#{expression}$")<br>> 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></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