Class: SolargraphTestCoverage::RSpecRunner

Inherits:
TestRunner
  • Object
show all
Defined in:
lib/solargraph_test_coverage/test_runner.rb

Overview

Test Runner Subclass for RSpec

Instance Method Summary collapse

Methods inherited from TestRunner

#initialize, #run!, with

Constructor Details

This class inherits a constructor from SolargraphTestCoverage::TestRunner

Instance Method Details

#failed_examplesObject



53
54
55
56
57
58
59
# File 'lib/solargraph_test_coverage/test_runner.rb', line 53

def failed_examples
  return unless output

  output['examples']
    .select { |example| example['status'] == 'failed' }
    .map { |example| { line_number: example['line_number'] - 1, message: example.dig('exception', 'message') } }
end

#passed?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/solargraph_test_coverage/test_runner.rb', line 61

def passed?
  @result&.zero?
end