$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'rubygems' if RUBY_VERSION < '1.9.0' && ENV['C_EXT'] require 'jmongo' #require 'test/unit' require 'awesome_print' require 'minitest/autorun' def silently warn_level = $VERBOSE $VERBOSE = nil result = yield $VERBOSE = warn_level result end def apr(obj, prefix = '=====') puts prefix ap obj puts '=====' end begin require 'rubygems' if RUBY_VERSION < "1.9.0" && !ENV['C_EXT'] silently { require 'shoulda' } silently { require 'mocha' } rescue LoadError puts < e assert_equal klass, e.class assert e.message.include?(message), "#{e.message} does not include #{message}." else flunk "Expected assertion #{klass} but none was raised." end end end