diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-17 02:39:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-17 02:39:02 +0000 |
commit | 9efcd10371979a33b790a168b175e59e4a12142a (patch) | |
tree | 5cbde009d47319422c4d38e07eb879701c277ae6 /lib/test | |
parent | 9e39bc1a088e0ac8cb6433c4daab03136253bf9d (diff) |
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
Diffstat (limited to 'lib/test')
-rw-r--r-- | lib/test/unit/assertions.rb | 14 |
1 files changed, 5 insertions, 9 deletions
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 |