Created
March 22, 2010 14:25
-
-
Save zbelzer/340120 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Drop all columns after each test case. | |
def teardown | |
MongoMapper.database.collections.each do |coll| | |
coll.remove unless coll.name =~ /^system\./ | |
end | |
end | |
# Make sure that each test case has a teardown | |
# method to clear the db after each test. | |
def inherited(base) | |
base.define_method teardown do | |
super | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment