Module: Minidoc::TestHelpers
Instance Method Summary collapse
- #clear_collections ⇒ Object
- #clear_database ⇒ Object
- #clear_indexes ⇒ Object
- #each_collection(&block) ⇒ Object
Instance Method Details
#clear_collections ⇒ Object
10 11 12 |
# File 'lib/minidoc/test_helpers.rb', line 10 def clear_collections each_collection { |c| c.remove({}) } end |
#clear_database ⇒ Object
5 6 7 8 |
# File 'lib/minidoc/test_helpers.rb', line 5 def clear_database clear_collections clear_indexes end |
#clear_indexes ⇒ Object
14 15 16 |
# File 'lib/minidoc/test_helpers.rb', line 14 def clear_indexes each_collection(&:drop_indexes) end |
#each_collection(&block) ⇒ Object
18 19 20 21 22 |
# File 'lib/minidoc/test_helpers.rb', line 18 def each_collection(&block) Minidoc.database.collections. reject { |c| c.name.include?("system") }. each(&block) end |