Class: Protest::Reports::Documentation

Inherits:
Protest::Report show all
Includes:
Utils::ColorfulOutput, Utils::Summaries
Defined in:
lib/protest/reports/documentation.rb

Overview

For each testcase in your suite, this will output the description of the test case (whatever you provide TestCase.context), followed by the name of each test in that context, one per line. For example:

Protest.context "A user" do
  test "has a name" do
    ...
  end

  test "has an email" do
    ...
  end

  context "validations" do
    test "ensure the email can't be blank" do
      ...
    end
  end
end

Will output, when run with the :documentation report:

A user
- has a name
- has an email

A user validations
- ensure the email can't be blank

This is based on the specdoc runner in rspec.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::ColorfulOutput

colors, #print, #puts

Methods included from Utils::Summaries

#summarize_errors, #summarize_pending_tests, #summarize_test_totals

Methods inherited from Protest::Report

#add_assertion, #assertions, #errors, #failures, #failures_and_errors, on, #passes, #pendings, #tests, #time_elapsed, #total_tests

Constructor Details

#initialize(stream = STDOUT) ⇒ Documentation

Set the stream where the report will be written to. STDOUT by default.



39
40
41
# File 'lib/protest/reports/documentation.rb', line 39

def initialize(stream=STDOUT)
  @stream = stream
end

Instance Attribute Details

#streamObject (readonly)

:nodoc:



36
37
38
# File 'lib/protest/reports/documentation.rb', line 36

def stream
  @stream
end