[ruby/yarp] Truly fix snapshot testing on Ruby CI
https://github.com/ruby/yarp/commit/c4e835711e
This commit is contained in:
parent
51ff9cd747
commit
39a40af14f
@ -21,7 +21,6 @@ class ParseTest < Test::Unit::TestCase
|
|||||||
# and the line breaks based on the length of the path.
|
# and the line breaks based on the length of the path.
|
||||||
def normalize_printed(printed)
|
def normalize_printed(printed)
|
||||||
printed
|
printed
|
||||||
.b
|
|
||||||
.gsub(
|
.gsub(
|
||||||
/SourceFileNode \s*
|
/SourceFileNode \s*
|
||||||
\(\s* (\d+\.\.\.\d+) \s*\) \s*
|
\(\s* (\d+\.\.\.\d+) \s*\) \s*
|
||||||
@ -99,7 +98,7 @@ class ParseTest < Test::Unit::TestCase
|
|||||||
assert_empty result.errors, value
|
assert_empty result.errors, value
|
||||||
|
|
||||||
if File.exist?(snapshot)
|
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
|
# If the snapshot file exists, but the printed value does not match the
|
||||||
# snapshot, then update the snapshot file.
|
# snapshot, then update the snapshot file.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user