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:
- you can now use negative numbers in numeric field values when creating objects, and
- you can use some extra default step definitions to verify the non-existence of objects
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.
[...] 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 [...]