[rspec-users] Reuse steps like a method call

David Chelimsky dchelimsky at gmail.com
Wed May 14 16:17:41 EDT 2008


On May 14, 2008, at 3:07 PM, Zach Dennis wrote:

> On Wed, May 14, 2008 at 2:24 PM, David Chelimsky  
> <dchelimsky at gmail.com> wrote:
> On May 14, 2008, at 12:45 PM, Bryan Helmkamp wrote:
>
> If I have a step matcher defined as so:
>
> Given "a user named $username" do |username|
> ....
> end
>
> Is there a way to call it from another step? For example:
>
> Given "a user named $username with a blog post |username|
>  given_a_user_named(username) # calls existing step code
>  # create a blog post
> end
>
> I'm pretty sure you can do this:
>
>
> Given "a user named $username with a blog post |username|
>  Given "a user named #{username}"
>  # create a blog post
> end
>
> Is this by intention or just a side effect of the current  
> implementation?

You'll have to ask Dan - Dan?


>
> -- 
> Zach Dennis
> http://www.continuousthinking.com  
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080514/7d45e5f3/attachment.html>


More information about the rspec-users mailing list