diff options
Diffstat (limited to 'lib/test/unit/assertions.rb')
-rw-r--r-- | lib/test/unit/assertions.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index 821faf5803..9a6d643623 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -10,6 +10,15 @@ module Test obj.pretty_inspect.chomp end + def assert(test, msg = (nomsg = true; nil)) + unless nomsg or msg.instance_of?(String) or msg.instance_of?(Proc) or + (bt = caller).shift.rindex(MiniTest::MINI_DIR, 0) + bt = MiniTest.filter_backtrace(bt) + raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt + end + super + end + def assert_raise(*args, &b) assert_raises(*args, &b) end |