[ruby/yarp] Truly fix snapshot testing on Ruby CI

https://github.com/ruby/yarp/commit/c4e835711e
This commit is contained in:
Kevin Newton 2023-06-21 17:28:24 -04:00 committed by git
parent 51ff9cd747
commit 39a40af14f

View File

@ -21,7 +21,6 @@ class ParseTest < Test::Unit::TestCase
# and the line breaks based on the length of the path.
def normalize_printed(printed)
printed
.b
.gsub(
/SourceFileNode \s*
\(\s* (\d+\.\.\.\d+) \s*\) \s*
@ -99,7 +98,7 @@ class ParseTest < Test::Unit::TestCase
assert_empty result.errors, value
if File.exist?(snapshot)
normalized = normalize_printed(File.binread(snapshot))
normalized = normalize_printed(File.read(snapshot))
# If the snapshot file exists, but the printed value does not match the
# snapshot, then update the snapshot file.