From c2dd855a0f0166815e0e7cac71d11bdfd6d3c242 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 10 Nov 2025 15:59:18 +0900 Subject: [PATCH] assert_separately: Suppress experimental warnings test-unit depends on power_assert that the recent versions require ruby 3.1 or later. While test-unit rescues syntax error at loading power_assert for old ruby versions, warnings for experimental features are not suppressed, and `assert_separately` fails because stderr is not empty, by default. Since adding `required_ruby_version` to power_assert causes the installation with old rubygems to fail, we just ignore warnings for experimental features totally. --- lib/core_assertions.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/core_assertions.rb b/lib/core_assertions.rb index 02038aa..b95a70e 100644 --- a/lib/core_assertions.rb +++ b/lib/core_assertions.rb @@ -328,6 +328,8 @@ def assert_separately(args, file = nil, line = nil, src, ignore_stderr: nil, **o args = args.dup args.insert((Hash === args.first ? 1 : 0), "-w", "--disable=gems", *$:.map {|l| "-I#{l}"}) args << "--debug" if RUBY_ENGINE == 'jruby' # warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag + # power_assert 3 requires ruby 3.1 or later + args << "-W:no-experimental" if RUBY_VERSION < "3.1." stdout, stderr, status = EnvUtil.invoke_ruby(args, src, capture_stdout, true, **opt) ensure if res_c