Skip to content

Commit

Permalink
Check test RBI files for well-formedness
Browse files Browse the repository at this point in the history
  • Loading branch information
paracycle committed Oct 20, 2021
1 parent f43534b commit 2775d2b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion spec/dsl_spec.rb
Expand Up @@ -91,6 +91,23 @@ def rbi_for(constant_name)
file.root.nest_non_public_methods!
file.root.group_nodes!
file.root.sort_nodes!
file.string
file.string.tap do |str|
output = Tapioca::Compilers::Sorbet.run(
"--no-config",
"--stop-after",
"parser",
"-e",
str,
quiet: false
)

assert($?.success?, <<~MSG) # rubocop:disable Style/SpecialGlobalVars
Expected generated RBI file for `#{constant_name}` with no parsing errors.
Got these parsing errors:
#{indented(output, 2)}
MSG
end
end
end

0 comments on commit 2775d2b

Please sign in to comment.