diff options
Diffstat (limited to 'lib/test/unit')
-rw-r--r-- | lib/test/unit/assertions.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index 9a646c0867..5a0c01a4fb 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -10,10 +10,13 @@ module Test obj.pretty_inspect.chomp end - def assert(test, msg = nil) + UNASSIGNED = Object.new # :nodoc: + + def assert(test, msg = UNASSIGNED) case msg - when String, Proc, NilClass - # do nothing + when UNASSIGNED + msg = nil + when String, Proc else bt = caller.reject { |s| s.rindex(MiniTest::MINI_DIR, 0) } raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt |