Class TapReporter
This reporter will print the results using thr Test anything protocol version 13
Constructors
| Name | Description |
|---|---|
this
()
|
Methods
| Name | Description |
|---|---|
begin
(__param_0, __param_1)
|
|
end
(__param_0)
|
|
update
()
|
Example
it should print "The Plan" at the beginning
auto writer = new BufferedWriter;
auto reporter = new TapReporter(writer);
reporter .begin(10);
writer .buffer .should .equal("TAP version 13\n1..10\n");
Example
it should print a sucess test
auto writer = new BufferedWriter;
auto reporter = new TapReporter(writer);
auto test = new TestResult("other test");
test .status = TestResult .Status .success;
reporter .end("some suite", test);
writer .buffer .should .equal("ok - some suite.other test\n");
Example
it should print a failing test with a basic throwable
auto writer = new BufferedWriter;
auto reporter = new TapReporter(writer);
auto test = new TestResult("other's test");
test .status = TestResult .Status .failure;
test .throwable = new Exception("Test's failure", "file.d", 42);
reporter .end("some suite", test);
writer .buffer .should .equal("not ok - some suite.other's test\n" ~
" ---\n" ~
" message: 'Test\'s failure'\n" ~
" severity: failure\n" ~
" location:\n" ~
" fileName: 'file.d'\n" ~
" line: 42\n\n");
Example
it should not print the YAML if the throwable is missing
auto writer = new BufferedWriter;
auto reporter = new TapReporter(writer);
auto test = new TestResult("other's test");
test .status = TestResult .Status .failure;
reporter .end("some suite", test);
writer .buffer .should .equal("not ok - some suite.other's test\n");