summaryrefslogtreecommitdiff
path: root/lib/test/unit
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-22 05:50:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-22 05:50:17 +0000
commitcb9ffb8d1cc1a784674e0f1594582b1406547dbd (patch)
treebd233d95e4c34fba58f65a3bedd037370d0c9bf0 /lib/test/unit
parente1d15712565ef38f7acd605dc1aafb3884b6a008 (diff)
* 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
Diffstat (limited to 'lib/test/unit')
-rw-r--r--lib/test/unit/assertions.rb7
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