cucumber 0.1.9 I have this: When /obtain the party (.*)/ do |n| n case when "common name" @party.entity_name = "Anything will do" when "legal name" @party.entity_legal_name = "Something a Bit Longer I SHOULD think" when "corporate form" @party.entity_legal_form = "PERS" else raise ArgumentError, "#{n} attribute is not provided for." end end When /should determine the party (.*) do |n| When "obtain the party #{n}" end # rake features gives this error: /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'': ./features/step_definitions/entity_steps.rb:28: unknown regexp options - rcrd (SyntaxError) ./features/step_definitions/entity_steps.rb:28: syntax error Then /record the party/ do ^ ./features/step_definitions/entity_steps.rb:28: syntax error I understood that as of 0.1.7 cucumber supported steps from step calls. Have I mistyped or misunderstood something -- Posted via http://www.ruby-forum.com/.
James Byrne wrote:> When /should determine the party (.*) do |n| > When "obtain the party #{n}" > end >Missed the next follow on lines. Snippet should be: When /should determine the party (.*) do |n| When "obtain the party #{n}" end Then /record the party/ do Entity.destroy_all @party.save! end -- Posted via http://www.ruby-forum.com/.
James Byrne wrote:> James Byrne wrote: > >> When /should determine the party (.*) do |n| >> When "obtain the party #{n}" >> end >> >Another helpful tidbit that I neglected to post. The reason that I focused on the step from step method shown above is that when I comment these lines out the following method "Then /record the party/" run fine. -- Posted via http://www.ruby-forum.com/.
Missing slash at end of regex /When /should determine the party (.*)/ 2008/11/24 James Byrne <lists at ruby-forum.com>:> James Byrne wrote: >> James Byrne wrote: >> >>> When /should determine the party (.*) do |n| >>> When "obtain the party #{n}" >>> end >>> >> > > Another helpful tidbit that I neglected to post. The reason that I > focused on the step from step method shown above is that when I comment > these lines out the following method "Then /record the party/" run fine. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
It looks like you are not closing your regexp here:> When /should determine the party (.*) do |n| > When "obtain the party #{n}" > endSo it doesn''t close until it gets here, where you are trying to start a new one:> Then /record the party/ do > Entity.destroy_all > @party.save! > endAnd then is treating ''record'' as options to the regexp and not recognizing some of them> # rake features gives this error: > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require'': ./features/step_definitions/entity_steps.rb:28: > unknown regexp options - rcrd (SyntaxError) >./features/step_definitions/entity_steps.rb:28: syntax error Then /recordthe party/ do> ^ > ./features/step_definitions/entity_steps.rb:28: syntax error__________ Information from ESET NOD32 Antivirus, version of virus signature database 3636 (20081124) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
On 2008-11-24, at 11:16, James Byrne wrote:> I have this: > > When /obtain the party (.*)/ do |n| > n caseHi James. Shouldn''t that be "case n"? -Nick
Nick Hoffman wrote:> On 2008-11-24, at 11:16, James Byrne wrote: >> I have this: >> >> When /obtain the party (.*)/ do |n| >> n case > > Hi James. Shouldn''t that be "case n"? > -NickYes.> Missing slash at end of regex> /When /should determine the party (.*)/Sighhhh.... Thanks. -- Posted via http://www.ruby-forum.com/.