test/testing.rb in mongoid-grid_fs-2.1.0 vs test/testing.rb in mongoid-grid_fs-2.2.0
- old
+ new
@@ -1,7 +1,7 @@
# -*- encoding : utf-8 -*-
-require 'test/unit'
+require 'minitest/autorun'
testdir = File.expand_path(File.dirname(__FILE__))
rootdir = File.dirname(testdir)
libdir = File.join(rootdir, 'lib')
@@ -19,11 +19,11 @@
words.map!{|word| word.gsub %r/[^0-9a-zA-Z_-]/, ''}
words.delete_if{|word| word.nil? or word.strip.empty?}
new(words.join('-').downcase)
end
end
-
+
class Context
attr_accessor :name
def initialize(name, *args)
@name = name
@@ -34,11 +34,12 @@
end
end
end
def Testing(*args, &block)
- Class.new(::Test::Unit::TestCase) do
+ Class.new(::Minitest::Test) do
+ i_suck_and_my_tests_are_order_dependent!
## class methods
#
class << self
def contexts
@@ -131,11 +132,11 @@
end
if block
label = "assert(#{ args.join(' ') })"
result = nil
- assert_nothing_raised{ result = block.call }
+ result = block.call
__assert__(result, label)
result
else
result = args.shift
label = "assert(#{ args.join(' ') })"
@@ -173,10 +174,10 @@
module_eval(&block)
self.setup()
self.prepare.each{|b| b.call()}
- at_exit{
+ at_exit{
self.teardown()
self.cleanup.each{|b| b.call()}
}
self