Calling a step from a step

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

James B. 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

James B. wrote:

James B. 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.

Missing slash at end of regex

/When /should determine the party (.*)/

2008/11/24 James B. [email protected]:

It looks like you are not closing your regexp here:

When /should determine the party (.*) do |n|
When “obtain the party #{n}”
end

So 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!
end

And 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 /record
the 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

Nick H. wrote:

On 2008-11-24, at 11:16, James B. wrote:

I have this:

When /obtain the party (.*)/ do |n|
n case

Hi James. Shouldn’t that be “case n”?
-Nick

Yes.

Missing slash at end of regex

/When /should determine the party (.*)/

Sighhhh… Thanks.

On 2008-11-24, at 11:16, James B. wrote:

I have this:

When /obtain the party (.*)/ do |n|
n case

Hi James. Shouldn’t that be “case n”?
-Nick

On 2008-11-24, at 11:47, James B. wrote:

Missing slash at end of regex

/When /should determine the party (.*)/

Sighhhh… Thanks.

Hey, it happens to the best of us, mate. At least it’s an easy fix!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs