[rspec-users] Step matchers

David Chelimsky dchelimsky at gmail.com
Mon Oct 15 19:28:22 EDT 2007


On 10/15/07, Pat Maddox <pergesu at gmail.com> wrote:
> Well, I'm not sure that anyone was suggesting that we ditch the
> current way.  I certainly wasn't.  If you want to embed code then you
> can.

Actually - if we do go down this path, I'd like to see the embedded
code go away. The structure that exists right now is built around
supporting embedded code. The structure needed in the case of using a
parser could be much simpler and, personally, I don't see a reason to
be supporting both approaches if the parsing approach has enough
flexibility built into it that we can essentially hook up any
arbitrary code to it.

> Although, this new way solves a more common problem than just making
> specs pretty for customers.  Sharing steps right now is kind of a
> pain.  You have to write a helper method somewhere, and then in every
> single story file you have to do
>
> Given "a user named", "Pat" do |name|
>   create_user name
> end
>
> Which is still too much duplication for my taste.
>
> When you realize that you don't need to embed code (because the steps
> are extracted elsewhere), the reasons for expressing stories in code
> at all falls away.

Hear, hear!

Cheers,
David


More information about the rspec-users mailing list