From 9908177857a28633d6279c43a1ad4dfedcb98596 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 17 Dec 2020 20:06:18 +0900 Subject: test/ruby: Check warning messages at a finer granularity Instead of suppressing all warnings wholly in each test scripts by setting `$VERBOSE` to `nil` in `setup` methods. --- tool/lib/test/unit/core_assertions.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tool') diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb index 05bf2c27e1..c4c271403b 100644 --- a/tool/lib/test/unit/core_assertions.rb +++ b/tool/lib/test/unit/core_assertions.rb @@ -587,6 +587,13 @@ eom assert_warning(*args) {$VERBOSE = false; yield} end + def assert_deprecated_warning(mesg = /deprecated/) + assert_warning(mesg) do + Warning[:deprecated] = true + yield + end + end + class << (AssertFile = Struct.new(:failure_message).new) include CoreAssertions def assert_file_predicate(predicate, *args) -- cgit v1.2.3