Skip to content

Commit 03090e2

Browse files
Earlopainmatzbot
authored andcommitted
[ruby/prism] Change bin/prism errors to take source and print errors
This is more akin to how all the other ones work. Instead I added most of this to the errors test like focusing a few specifically and creating new expectations. ruby/prism@b21922b0a1
1 parent 30d2e0c commit 03090e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/prism/errors_test.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
module Prism
88
class ErrorsTest < TestCase
99
base = File.expand_path("errors", __dir__)
10-
filepaths = Dir["**/*.txt", base: base]
10+
filepaths = Dir[ENV.fetch("FOCUS", "**/*.txt"), base: base]
1111

1212
filepaths.each do |filepath|
1313
ruby_versions_for(filepath).each do |version|
@@ -100,6 +100,10 @@ def assert_errors(filepath, version)
100100
refute_empty errors, "Expected errors in #{filepath}"
101101

102102
actual = result.errors_format
103+
if expected != actual && ENV["UPDATE_SNAPSHOTS"]
104+
File.write(filepath, actual)
105+
end
106+
103107
assert_equal expected, actual, "Expected errors to match for #{filepath}"
104108
end
105109
end

0 commit comments

Comments
 (0)