lib/minitest/utils/extension.rb in minitest-utils-0.2.3 vs lib/minitest/utils/extension.rb in minitest-utils-0.2.4
- old
+ new
@@ -1,6 +1,22 @@
module Minitest
+ module Utils
+ module Assertions
+ def assert(test, message = nil)
+ message ||= "expected: truthy value\ngot: #{mu_pp(test)}"
+ super(test, message)
+ end
+
+ def refute(test, message = nil)
+ message ||= "expected: falsy value\ngot: #{mu_pp(test)}"
+ super(test, message)
+ end
+ end
+ end
+
class Test
+ include ::Minitest::Utils::Assertions
+
def self.test(name, &block)
test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
defined = method_defined? test_name
raise "#{test_name} is already defined in #{self}" if defined