Created
May 30, 2012 13:53
-
-
Save jacaetevha/2836460 to your computer and use it in GitHub Desktop.
hooks for DatabaseCleaner in Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ActiveSupport::TestCase | |
| # ... | |
| class << self | |
| def startup | |
| DatabaseCleaner.clean | |
| end | |
| def shutdown | |
| DatabaseCleaner.clean | |
| end | |
| def suite | |
| mysuite = super | |
| def mysuite.run(*args) | |
| ActiveSupport::TestCase.startup | |
| super | |
| ActiveSupport::TestCase.shutdown | |
| end | |
| mysuite | |
| end | |
| end | |
| # ... | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment