From cb9ffb8d1cc1a784674e0f1594582b1406547dbd Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 22 Oct 2010 05:50:17 +0000 Subject: * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): assertion message must not be nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/test/unit/assertions.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/test/unit') 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 -- cgit v1.2.3