[rspec-users] Variance in behaviour: rake features vs. autotest

Andrew Premdas apremdas at gmail.com
Sat Nov 29 20:52:17 EST 2008


No it isn't you can have

When /determine the party (.*)/ do

And call that in in other nested step using a string literal

When
   When "deterimine the party foo"
end

In fact I never enclose the arguments with a string delimiter as I
think it makes the feature less clear - don't think feature writers
should have to worry about having correct quotes. just my 2c



2008/11/28 James Byrne <lists at ruby-forum.com>:
> aslak hellesoy wrote:
>
>>> "Worthy of note is that, inside the step files, one must enclose the
>>> arguments to the *Given/When/Then/And* methods with a string delimiter":
>>
>> This is only a convention to make it easier to know what's a variable
>> when reading/editing a feature. It is absolutely not a must.
>>
>
> It is a must inside step files:
>
> When /determine the party "(.*)"/ do |n|
>  When obtain the party n
> end
>
> results in
>
>    And I determine the party "corporate form"              #
> features/entities/
> step_definitions/entity_steps.rb:56
>      undefined method `party' for
> #<ActionController::Integration::Session:0x7e
> e6c3b8> (NoMethodError)
>
> While
>
> When /determine the party "(.*)"/ do |n|
>  When "obtain the party \"#{n}\""
> end
>
> passes.
>
>  Scenario: Record Entity basic identification information  #
> features/entities/
> entity.feature:17
>
>    And I determine the party "corporate form"              #
> features/entities/
> step_definitions/entity_steps.rb:56
>    Then I should save the party information                #
> features/entities/
> step_definitions/entity_steps.rb:60
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list