Michael MacDonald

More Pickle Action

In Rails, Testing on November 3, 2009 at 8:00 am

In a previous blogpost I championed the benefits of using Pickle with Cucumber to speed up your BDD. Recently, I was able to contribute back to Pickle in a small way with the following two changes:

This means you can do things like this in your plain text cucumber steps:

Given a user exists with name: "Digby", bank_balance: -43.25

And if you need to, you can also be explicit with the positive sign:

And another user exists with name: "Miranda", bank_balance: +86.50

The extra step definitions allow you to do the following:

Then a user should not exist with name: "Maya"
And the first user should not be one of the last user's debtors
And the last user should not be the first user's creditor

These are the “not” versions of some of the existing default step definitions. I found that I was needing these in my Rails projects and thought they would be good to have in the standard Pickle. Ian White, the creator of Pickle, agreed.

It feels good to contribute back to an open source project, even in a small way, and I encourage you all to try to do so as well.

Advertisements
  1. […] In Rails, Testing on November 26, 2009 at 12:12 am Following on from my original and followup articles on using Pickle with Cucumber, a brand new version of Pickle is now available. Version 0.2.0 now […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: