Skip to content

Commit 942ba81

Browse files
committed
added documentation to Approvals w/ @samanthalangit
1 parent 77b9c1a commit 942ba81

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/main/java/org/teachingextensions/approvals/lite/Approvals.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
*/
2525
public class Approvals
2626
{
27+
/**
28+
* Verifies the output file (received) against a Golden Master file (approved)<br/>
29+
* If there is no GoldenMaster, then the test will fail
30+
* <div><b>Example:</b> {@code Approvals.verify(response)}</div>
31+
*
32+
* @param response
33+
* The string to be verified
34+
*/
2735
public static void verify(String response) throws Exception
2836
{
2937
verify(new ApprovalTextWriter(response, "txt"), FileTypes.Text);
@@ -60,6 +68,14 @@ public static void verifyHtml(String response) throws Exception
6068
{
6169
verify(new ApprovalTextWriter(response, "html"), FileTypes.Html);
6270
}
71+
/**
72+
* Verifies the output file (received) against a Golden Master file (approved) <br/>
73+
* If there is no GoldenMaster, then the test will fail
74+
* <div><b>Example:</b> {@code Approvals.verify(component)}</div>
75+
*
76+
* @param component
77+
* The component to be verified
78+
*/
6379
public static void verify(Component component)
6480
{
6581
Approvals.verify(new ComponentApprovalWriter(component), FileTypes.Image);
@@ -111,6 +127,15 @@ public static ApprovalNamer createApprovalNamer()
111127
{
112128
return new JUnitStackTraceNamer();
113129
}
130+
/**
131+
* Verifies the output file (received) against a Golden Master file (approved)<br/>
132+
* If there is no GoldenMaster, then the test will fail
133+
* <div><b>Example:</b> {@code Approvals.verify(object)}</div>
134+
*
135+
* @param response
136+
* The object to be verified <br/>
137+
* NOTE: the object will be returned as a String
138+
*/
114139
public static void verify(Object o) throws Exception
115140
{
116141
Approvals.verify(o + "");

0 commit comments

Comments
 (0)