From a97dedf761c6931cbb2b9267faad2395481a3f57 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Sat, 26 Aug 2023 09:56:44 -0400 Subject: [ruby/irb] Fix deprecation test when ran multiple times (https://github.com/ruby/irb/pull/695) https://github.com/ruby/irb/commit/ae0e5bb80f --- test/irb/test_ruby_lex.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb index 336f4fd366..09344e1b0e 100644 --- a/test/irb/test_ruby_lex.rb +++ b/test/irb/test_ruby_lex.rb @@ -203,11 +203,10 @@ module TestIRB end def test_initialising_the_old_top_level_ruby_lex - _, err = capture_output do + assert_in_out_err(["--disable-gems", "-W:deprecated"], <<~RUBY, [], /warning: constant ::RubyLex is deprecated/) + require "irb" ::RubyLex.new(nil) - end - - assert_match(/warning: constant ::RubyLex is deprecated/, err) + RUBY end private -- cgit v1.2.3