method
new
new(options, output)
public
Formatters are initialized with options and output arguments. RSpec’s built-in formatters already expect this, and any custom formatters should as well.
Parameters
options: | A struct containing boolean values for colour, autospec, and dry_run |
output: | Used by RSpec’s built-in formatters to determine where to write the output. Default is STDOUT, otherwise a filename is expected. |
Example
If you invoke the spec command with:
--format progress:progress_report.txt
… the value of output will be progress_report.txt. If you don’t identify an output destination, the default is STDOUT.