Faster database cleaner for MySQL
- Add it your gemfile
gem 'db-nuker'
- Create file
spec/support/db_nuker.rb
RSpec.configure do |config|
config.use_transactional_fixtures = false
config.before(:suite) do
DBNuker.boom!
end
config.after(:each) do
DBNuker.boom!
end
end
- Enjoy!
Pure magic!
It cleans only those tables that have records in them
Doesn't reset the tables auto-increments. Well, you shouldn't rely on certain IDs in your tests anyways.
All code in this repository is released under the terms of the MIT license
Copyright (C) 2014 Nikolay Nemshilov