From 23375c8b81e07644517e5ad985b2fbf5e1b5d545 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 29 Apr 2019 13:42:50 +0900 Subject: [PATCH] Make only `mesg` can be assigned with default `fname` --- test/lib/test/unit/assertions.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/lib/test/unit/assertions.rb b/test/lib/test/unit/assertions.rb index caee3b18f7..51f89d5ae0 100644 --- a/test/lib/test/unit/assertions.rb +++ b/test/lib/test/unit/assertions.rb @@ -500,7 +500,9 @@ EOT end end - def prepare_syntax_check(code, fname = caller_locations(2, 1)[0], mesg = fname.to_s, verbose: nil) + def prepare_syntax_check(code, fname = nil, mesg = nil, verbose: nil) + fname ||= caller_locations(2, 1)[0] + mesg ||= fname.to_s verbose, $VERBOSE = $VERBOSE, verbose case when Array === fname