diff options
Diffstat (limited to 'lib/test')
-rw-r--r-- | lib/test/unit/assertions.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index b9fc2bcf12..ce28042c49 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -13,8 +13,11 @@ module Test UNASSIGNED = Object.new # :nodoc: def assert(test, msg = UNASSIGNED) - msg = nil if msg == UNASSIGNED - unless String === msg or Proc === msg or msg.nil? then + case msg + 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 end |