diff --git a/README.md b/README.md index c4c1197..b98560f 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ All configuration options must be nested under the `Ruby LSP RSpec` addon within { // ... "rubyLsp.addonSettings": { - "Ruby LSP RSpec": { + "ruby-lsp-rspec": { // Configuration options go here } } @@ -87,7 +87,7 @@ Customize the command used to run tests via CodeLens. If not set, the command wi { // ... "rubyLsp.addonSettings": { - "Ruby LSP RSpec": { + "ruby-lsp-rspec": { "rspecCommand": "rspec -f d" } } @@ -107,7 +107,7 @@ Enable debug logging. Currently, this only logs the RSpec command used by CodeLe ```json { "rubyLsp.addonSettings": { - "Ruby LSP RSpec": { + "ruby-lsp-rspec": { "debug": true } } diff --git a/lib/ruby_lsp/ruby_lsp_rspec/rspec_formatter.rb b/lib/ruby_lsp/ruby_lsp_rspec/rspec_formatter.rb index f7cfa42..a6670d8 100644 --- a/lib/ruby_lsp/ruby_lsp_rspec/rspec_formatter.rb +++ b/lib/ruby_lsp/ruby_lsp_rspec/rspec_formatter.rb @@ -2,22 +2,24 @@ # frozen_string_literal: true require "rspec/core/formatters" +require "rspec/core/formatters/progress_formatter" require "ruby_lsp/test_reporters/lsp_reporter" module RubyLsp module RSpec - class RSpecFormatter + class RSpecFormatter < ::RSpec::Core::Formatters::ProgressFormatter ::RSpec::Core::Formatters.register( self, :example_passed, :example_pending, :example_failed, :example_started, + :start_dump, :stop, ) def initialize(output) - @output = output + super(output) end def example_started(notification) @@ -29,6 +31,8 @@ def example_started(notification) end def example_passed(notification) + super(notification) + example = notification.example uri = uri_for(example) id = generate_id(example) @@ -36,6 +40,8 @@ def example_passed(notification) end def example_failed(notification) + super(notification) + example = notification.example uri = uri_for(example) id = generate_id(example) @@ -43,6 +49,8 @@ def example_failed(notification) end def example_pending(notification) + super(notification) + example = notification.example uri = uri_for(example) id = generate_id(example) @@ -63,4 +71,4 @@ def generate_id(example) end end end -end +end \ No newline at end of file