diff options
Diffstat (limited to 'lib/test')
-rw-r--r-- | lib/test/unit/assertions.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index 39a3c85600..f810d5a714 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -319,6 +319,14 @@ EOT template &&= template.chomp template.gsub(/\G((?:[^\\]|\\.)*?)(\\)?\?/) { $1 + ($2 ? "?" : mu_pp(arguments.shift)) } end + + def message(msg = nil, *args, &default) + if Proc === msg + super(nil, *args) {"#{msg.call}#{default.call if default}"} + else + super + end + end end end end |