From a0581b91d66e87ac7eb1783cbd18deda57c793d0 Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Wed, 25 Mar 2026 13:24:51 +0900 Subject: [PATCH] Fix test for Ruby 4.1 --- test/rbs/annotate/rdoc_source_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/rbs/annotate/rdoc_source_test.rb b/test/rbs/annotate/rdoc_source_test.rb index b9f4cd792..71234a294 100644 --- a/test/rbs/annotate/rdoc_source_test.rb +++ b/test/rbs/annotate/rdoc_source_test.rb @@ -72,7 +72,9 @@ class Hello3 refute_predicate klass, :documented? assert_nil RBS::Annotate::Formatter.translate(klass.comment.parse) - assert_equal "", RBS::Annotate::Formatter.translate(klass.comment.parse.parts[0]) + if part = klass.comment.parse.parts[0] # In ruby-4.1, parts is empty. + assert_equal "", RBS::Annotate::Formatter.translate(part) + end end end