public class FolderApprover extends Approver
Approves a folder. See verifyAllFiles(Path).
| Constructor and Description |
|---|
FolderApprover()
Standard FolderApprovals.
|
| Modifier and Type | Method and Description |
|---|---|
FolderApprover |
reportTo(Reporter reporter)
Specifies the reporter used to report mismatches.
|
FolderApprover |
testing(java.lang.Class<?> testClass)
Specifies the testClass to use as a folder name to store approved and received files.
|
void |
verifyAllFiles(java.nio.file.Path actualFolder)
Compares the actual output of your program (files in the folder
actualFolder) and the content of the approved “Master” folder matching with the test method. |
FolderApprover |
writeTo(java.lang.String customFileName)
Specifies the name to use for approved and received files.
|
public FolderApprover reportTo(Reporter reporter)
Specifies the reporter used to report mismatches.
public FolderApprover writeTo(java.lang.String customFileName)
Specifies the name to use for approved and received files.
public FolderApprover testing(java.lang.Class<?> testClass)
Specifies the testClass to use as a folder name to store approved and received files.
public void verifyAllFiles(java.nio.file.Path actualFolder)
Compares the actual output of your program (files in the folder actualFolder) and the content of the approved “Master” folder matching with the test method.
It’ll use a temporary received folder to copy the actual files from your program. This folder and its files will be erased in case the results are matching. Otherwise, they will be kept for you to review it.
In case of differences found in the output, the Reporter linked to this Approvals instance will be called (Reporter.mismatch(Path, Path)) for each mismatched file.
actualFolder - the folder containing the output of your program. It will be compared to the associated approved folderjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedCopyright © 2018 Write Them First!. All rights reserved.