[rspec-users] [ANN] database_resetter 0.1.0
ashley.moran at patchspace.co.uk
Sun Jul 4 15:00:47 EDT 2010
Apologies for cross-posting and spam in the same post. Hopefully you'll let me off this once...
I just released my first gem (woo!), database_resetter. It's designed to completely rebuild your Rails/Merb etc database before a Cucumber/RSpec every time a migration changes. Basically it prevents you seeing "unknown column" etc errors because you forgot to migrate the DB before a test run.
It's complementary to, not a replacement for, database_cleaner. database_resetter runs 0-1 times per Cucumber/RSpec run, whereas database_cleaner runs 0-1 times per Cucumber scenario / RSpec example.
I've been using it for a year or two, but only just got round to packaging it up. It doesn't do much, but over hundreds of database rebuilds the time savings add up to a fair bit.
I've used it "untested"* until now, but I spent today putting some Cucumber features around it. They aren't perfect, but they sanity check most of what it does. There's a ReadMe in the gem with full instructions (they're as good as I could manage after a long day).
The official source is in a darcs repo hosted on Patch-Tag.
Feedback gratefully received - let me know if you find it useful, and please contact me with bug reports / feature requests. Like I say, this is my first gem, so I'm not expecting it to work well in the wild...
* it works on my machine
More information about the rspec-users