Class: Campa::Core::TestReport

Inherits:
Object
  • Object
show all
Defined in:
lib/campa/core/test_report.rb

Overview

Uses the result of a Campa::Core::Test#call execution to show a human readable summary of a test execution.

Instance Method Summary collapse

Instance Method Details

#call(result, env:) ⇒ Boolean

Receives the result of Campa::Core::Test#call and shows a (hopefully) useful test summary.

Parameters:

Returns:

  • (Boolean)

    true if all tests were successful (false otherwhise).



14
15
16
17
18
# File 'lib/campa/core/test_report.rb', line 14

def call(result, env:)
  success, failures = %i[success failures].map { |t| filter(t, result) }
  out = env[SYMBOL_OUT] || $stdout
  show_summary(success, failures, out)
end