From 9efcd10371979a33b790a168b175e59e4a12142a Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 17 Apr 2013 02:39:02 +0000 Subject: assertions.rb: remove UNASSIGNED * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): UNASSIGNED is not a valid message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/test/unit/assertions.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index 984d5be726..b532146051 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -12,10 +12,8 @@ module Test MINI_DIR = File.join(File.dirname(File.dirname(File.expand_path(__FILE__))), "minitest") #:nodoc: - UNASSIGNED = Object.new # :nodoc: - # :call-seq: - # assert( test, failure_message = UNASSIGNED ) + # assert(test, [failure_message]) # #Tests if +test+ is true. # @@ -26,15 +24,13 @@ module Test #If no +msg+ is given, a default message will be used. # # assert(false, "This was expected to be true") - def assert(test, msg = UNASSIGNED) - case msg - when UNASSIGNED - msg = nil + def assert(test, *msgs) + case msg = msgs.first when String, Proc else - bt = caller.reject { |s| s.rindex(MINI_DIR, 0) } + bt = caller.reject { |s| s.start_with?(MINI_DIR) } raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt - end + end unless msgs.empty? super end -- cgit v1.2.3