Class: Loupe::PlainReporter

Inherits:
Reporter show all
Defined in:
lib/loupe/plain_reporter.rb

Overview

PlainReporter

A simple reporter that just prints dots and Fs to the terminal

Instance Attribute Summary

Attributes inherited from Reporter

#expectation_count, #failure_count, #failures, #success_count, #test_count

Instance Method Summary collapse

Methods inherited from Reporter

#<<, #exit_status, #increment_expectation_count, #increment_failure_count, #increment_success_count, #increment_test_count, #initialize

Constructor Details

This class inherits a constructor from Loupe::Reporter

Instance Method Details

This method returns an undefined value.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/loupe/plain_reporter.rb', line 10

def print_summary
  if @failures.empty?
    report = ""
  else
    report = +"\n\n"
    report << @failures.map!(&:to_s).join("\n")
  end

  print "\n\n"
  print <<~SUMMARY
    Tests: #{@test_count} Expectations: #{@expectation_count}
    Passed: #{@success_count} Failures: #{@failure_count}#{report}

    Finished in #{Time.now - @start_time} seconds
  SUMMARY
end