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

Joseph Wilk josephwilk at joesniff.co.uk
Tue Dec 16 10:40:22 EST 2008


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"
>   

This sounds like something that might be better suited to a Before / After.

Before do
  Projects.delete_all
end
> 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?
>   
Which type of report are you using? In my experience the pretty and html 
formatter when rending output do not display sub-steps.

Could you perhaps give an example of a report you are having problems with?

There is currently no support for excluding steps from documentation. 
Its an interesting idea but the example application of hiding steps from 
the user feels wrong to me. I think that if you need to hide it from the 
user then it does not really belong in the steps domain.

What do people think?

--
Joseph Wilk
http://blog.josephwilk.net
> Aidy
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>   



More information about the rspec-users mailing list