test/test_helper.rb in jnunemaker-mongomapper-0.2.0 vs test/test_helper.rb in jnunemaker-mongomapper-0.3.0

- old
+ new

@@ -1,6 +1,7 @@ require 'pathname' +require 'pp' require 'rubygems' require 'test/unit' require 'shoulda' gem 'mocha', '0.9.4' @@ -12,9 +13,13 @@ $LOAD_PATH.unshift(File.dirname(__FILE__)) dir = (Pathname(__FILE__).dirname + '..' + 'lib').expand_path require dir + 'mongomapper' class Test::Unit::TestCase + def clear_all_collections + MongoMapper::Document.descendants.map(&:delete_all) + end + custom_matcher :be_nil do |receiver, matcher, args| matcher.positive_failure_message = "Expected #{receiver} to be nil but it wasn't" matcher.negative_failure_message = "Expected #{receiver} not to be nil but it was" receiver.nil? end \ No newline at end of file