Class SpecReporter
This is the default reporter. The "spec" reporter outputs a hierarchical view nested just as the test cases are.
Methods
Name | Description |
---|---|
begin
(suite, )
|
Called before a test execution |
Example
it should print the test duration
auto writer = new BufferedWriter;
auto reporter = new SpecReporter(writer);
auto suite = SuiteResult("some.suite");
auto test = new TestResult("some test");
test .status = TestResult .Status .success;
test .end = Clock .currTime;
test .begin = test .end - 1 .seconds;
test .throwable = new Exception("Random failure");
reporter .end("some.suite", test);
writer .buffer .should .equal(
"\n" ~ " some\n" ~ " suite\n" ~ " ✓ some test (1000ms)\n");