Skip to content

Commit f0a9f48

Browse files
elmuertest0012
andauthored
Fix testing with coverage (#81)
* Notify coverage gathering is done When testing with coverage RubyLsp::LspReporter.instance.shutdown will not actually shutdown. It expects to be notified via at_coverage_exit so that it can gather coverage stats. * Either shutdown or coverage_exit depending on coverage status Co-authored-by: Stan Lo <[email protected]> --------- Co-authored-by: Stan Lo <[email protected]>
1 parent 3f02e7e commit f0a9f48

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/ruby_lsp/ruby_lsp_rspec/rspec_formatter.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ def example_pending(notification)
6161
end
6262

6363
def stop(notification)
64-
RubyLsp::LspReporter.instance.shutdown
64+
if RubyLsp::LspReporter.start_coverage?
65+
RubyLsp::LspReporter.instance.at_coverage_exit
66+
else
67+
RubyLsp::LspReporter.instance.shutdown
68+
end
6569
end
6670

6771
def uri_for(example)

0 commit comments

Comments
 (0)