From a6da8d69e616f6c0c937a2bf18ca3c0561a20b3d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 6 Oct 2024 00:45:46 +0900 Subject: [PATCH] [ruby/irb] Hash#inspect style has changed in ruby 3.4 [[Bug #20433]](https://bugs.ruby-lang.org/issues/20433) https://github.com/ruby/irb/commit/ecd08a527e --- test/irb/test_helper_method.rb | 3 ++- test/irb/test_irb.rb | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/irb/test_helper_method.rb b/test/irb/test_helper_method.rb index 291278c16a..a3e2c43b2f 100644 --- a/test/irb/test_helper_method.rb +++ b/test/irb/test_helper_method.rb @@ -76,7 +76,8 @@ module TestIRB type "exit" end - assert_include(output, '["required", "optional", ["splat"], "required", "optional", {:a=>1, :b=>2}, "block"]') + optional = {a: 1, b: 2} + assert_include(output, %[["required", "optional", ["splat"], "required", "optional", #{optional.inspect}, "block"]]) end def test_helper_method_injection_can_happen_after_irb_require diff --git a/test/irb/test_irb.rb b/test/irb/test_irb.rb index 2913f3d48e..617e9c9614 100644 --- a/test/irb/test_irb.rb +++ b/test/irb/test_irb.rb @@ -155,8 +155,8 @@ module TestIRB type 'exit' end - assert_include output, '{:context_changed=>true}' - assert_include output, '{:context_restored=>true}' + assert_include output, {context_changed: true}.inspect + assert_include output, {context_restored: true}.inspect end end