Skip to content

Commit 90e2539

Browse files
LarsEckartJayBazuziisidore
committed
. r extract method
Co-authored-by: Jay Bazuzi <[email protected]> Co-authored-by: Llewellyn Falco <[email protected]>
1 parent 4073050 commit 90e2539

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

approvaltests/src/main/java/org/approvaltests/approvers/FileApprover.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ public VerifyResult reportFailure(ApprovalFailureReporter reporter)
5858
}
5959
public void fail()
6060
{
61-
throw new Error(String.format("Failed Approval\n Approved:%s\n Received:%s", approved.getAbsolutePath(),
62-
received.getAbsolutePath()));
61+
throw createError(received.getAbsolutePath(), approved.getAbsolutePath());
62+
}
63+
private static Error createError(String received, String approved)
64+
{
65+
return new Error(String.format("Failed Approval\n Approved:%s\n Received:%s", approved, received));
6366
}
6467
public static VerifyResult approveTextFile(File received, File approved)
6568
{

0 commit comments

Comments
 (0)