From e884d65094e7b10b3e4c2764c83ed68db67666ab Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 4 Sep 2024 12:59:02 +0900 Subject: [PATCH] Ignore blocks to `Test::Unit::Assertions#pend` silently Although `pend` in test-unit gem expects the block does not pass if it is given, our `pend` should ignore the block silently as same as it just skips the test with no message by default. Add an unused parameter, to suppress the warning for the block to be ignored. --- tool/lib/test/unit/assertions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/lib/test/unit/assertions.rb b/tool/lib/test/unit/assertions.rb index aad422f7e7..fe3351107e 100644 --- a/tool/lib/test/unit/assertions.rb +++ b/tool/lib/test/unit/assertions.rb @@ -522,7 +522,7 @@ module Test # Skips the current test. Gets listed at the end of the run but # doesn't cause a failure exit code. - def pend msg = nil, bt = caller + def pend msg = nil, bt = caller, &_ msg ||= "Skipped, no message given" @skip = true raise Test::Unit::PendedError, msg, bt