From 5f46479543b1d070232cbb99a06194d8a2861198 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 23 Dec 2022 20:16:58 +0900 Subject: [PATCH] Fix fragile tests When the temporary path is long enough, the formatter may fold the path and may hit a hyphen at the end of line, and miscounted. --- test/rdoc/test_rdoc_ri_driver.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/rdoc/test_rdoc_ri_driver.rb b/test/rdoc/test_rdoc_ri_driver.rb index bf0719fae6..39e6e67759 100644 --- a/test/rdoc/test_rdoc_ri_driver.rb +++ b/test/rdoc/test_rdoc_ri_driver.rb @@ -598,7 +598,7 @@ def test_display_class assert_match %r%^= Attributes:%, out assert_match %r%^ attr_accessor attr%, out - assert_equal 1, out.scan(/-\n/).length + assert_equal 1, out.scan(/^-{50,}$/).length, out refute_match %r%Foo::Bar#blah%, out end @@ -622,7 +622,7 @@ def test_display_class_all assert_match %r%^= Attributes:%, out assert_match %r%^ attr_accessor attr%, out - assert_equal 6, out.scan(/-\n/).length + assert_equal 6, out.scan(/^-{50,}$/).length, out assert_match %r%Foo::Bar#blah%, out end