Skip to content

Instantly share code, notes, and snippets.

@devton
Created March 21, 2011 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devton/878944 to your computer and use it in GitHub Desktop.
Save devton/878944 to your computer and use it in GitHub Desktop.
Clear mongodb collection in end of the each
config.after(:each) do
puts "cleaning mongodb...."
Mongoid.database.collections.each do |collection|
unless collection.name =~ /^system\./
collection.remove
end
end
puts "finished cleaning mongodb."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment