Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/drewolson/timebomb

make your cucumber step definitions time aware
https://github.com/drewolson/timebomb

Last synced: about 1 month ago
JSON representation

make your cucumber step definitions time aware

Awesome Lists containing this project

README

        

= timebomb

If you're like me, you've found yourself with a cucumber
step definition like this:

Given /^I recieved an invitation$/ do
...
end

And you want to write a step definition like this:

Given /^I recieved an invitation 2 days ago$/ do
...
end

Well, timebomb to the rescue. It lets you append
time constraints to your cucumber step defintions by
mixing and matching:

- seconds, minutes, hours, days, weeks, months, years
- ago, from now

So with the following step definition:

Given /^I recieved an invitation$/ do
...
end

I can write any of the following:

Given I received an invitation 1 day from now
Given I received an invitation 2 weeks ago
Given I received an invitation 3 months from now
Given I received an invitation 15 years ago

Timebomb to the rescue, BOOM!

== Installing

Make sure you have gemcutter as your default source:

sudo gem install gemcutter
gem tumble

First install Timebomb

sudo gem install timebomb

Now, just require it in your cucumber env.rb file.
BOOM goes the dynamite.

== Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
(if you want to have your own version, that is fine but
bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2009 Drew Olson. See LICENSE for details.