[rspec-users] [Cucumber] factor out non-user steps

Pat Maddox pergesu at gmail.com
Tue Dec 16 15:51:23 EST 2008


Jonathan Linowes <jonathan at parkerhill.com> writes:

> On Dec 16, 2008, at 6:50 AM, aidy lewis wrote:
>
>> Hi,
>>
>> I have a step that has been defined by the user
>>
>> Given /a logged in user/ {}
>>
>> Now in that step I have my own step (not defined by the business)  of
>>
>> Given "all projects have been deleted"
>>
>> The second step needs to be included in the first
>>
>> Given /a logged in user/ do
>>   Given("all projects have been deleted")
>> end
>>
>> I am thinking that "all projects have been deleted" should be hidden
>> in the report.
>>
>> Is there a way to prevent the sub step from being reported or should I
>> factor that step
>> off to a standard method in the features/support folder?
>>
>> Aidy
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>
>
> or I would start with a  step like
>
> Given a site with no projects
>
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

And that step would be blank, because your database should already be
empty, or it's a precondition checking step like

Project.count.should == 0

Pat


More information about the rspec-users mailing list