public class ApprovalsFiles
extends java.lang.Object
Approval Testing relies on comparing data produced by a Program Under Tests and data which has been reviewed and validated by the developer. This validated data is stored in approved files along with the project, and is used for comparisons with the data produced by the program’s execution.
Two files are needed for computing Approval Tests: an approved file, which should be committed with the source code, containing data validated by the developer, and a received file, which temporarily holds the data produced by the Program Under Tests execution. Those files are then compared to validate the proper behavior of the program.
That ApprovalsFiles class can be seen as a companion to a test class since it provides useful methods allowing to read and write both approved and received files. It is linked to a test class since the produced files will be named after the test class and its methods.
An ApprovalsFiles object will be automatically created and attached to any created Approvals object, but you may choose to instantiate one yourself for accessing and managing the approved and received files of a particular class.
| Constructor and Description |
|---|
ApprovalsFiles()
Constructs an
ApprovalsFiles using the StackUtils.callerClass(Class). |
| Modifier and Type | Method and Description |
|---|---|
ApprobationContext |
context(java.lang.String methodName) |
ApprobationContext |
defaultContext() |
public ApprovalsFiles()
Constructs an ApprovalsFiles using the StackUtils.callerClass(Class).
public ApprobationContext defaultContext()
public ApprobationContext context(java.lang.String methodName)
Copyright © 2018 Write Them First!. All rights reserved.