class

Report::Custom

Inherits JSON::Serializable < CLI::Macros < Report < Reference < Object

A custom report format allowing to insert arbitrary content for a test.

The reports must be an array of objects with the keys name, category, status and content. status may only have the values failure or success.

Example:

[
  {
    "name": "meinTest",
    "category": "Kategorie",
    "status": "failure",
    "content": "<b>text</b>"
  },
  {
    "name": "meinTest2",
    "category": "Kategorie",
    "status": "success",
    "content": "<b>text</b>"
  }
]

WARNING: Using custom reports is discouraged outside of development phases as they are hard to translate or re-theme.

Constructors

new(category : String, name : String, status : Status, content : String)
Source
new(pull : JSON::PullParser)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Class methods

from_path(path : Path) : Enumerable(Report)
Source
is_candidate?(filename : String) : Bool
Source

Instance methods

category

The category this report is grouped in.

The string should be below ~20 characters to prevent the sidebar from overflowing.

Source
content
Source
name

The name displayed for this report.

The string should be below ~20 characters to prevent the sidebar from overflowing.

Source
render(io : IO) : Nil

A custom report format allowing to insert arbitrary content for a test.

The reports must be an array of objects with the keys name, category, status and content. status may only have the values failure or success.

Example:

[
  {
    "name": "meinTest",
    "category": "Kategorie",
    "status": "failure",
    "content": "<b>text</b>"
  },
  {
    "name": "meinTest2",
    "category": "Kategorie",
    "status": "success",
    "content": "<b>text</b>"
  }
]

WARNING: Using custom reports is discouraged outside of development phases as they are hard to translate or re-theme.

Source
status

The status of this report.

This will control the successful-test-count in the report header, filtering options and an indicator next to the test in the sidebar.

Source