summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/test/unit/assertions.rb7
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c382992e8..9a894da9bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 22 14:50:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
+ assertion message must not be nil.
+
Fri Oct 22 13:59:50 2010 NARUSE, Yui <naruse@ruby-lang.org>
* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
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