-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
approvaltests/src/main/java/org/approvaltests/FailedFileLog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.approvaltests; | ||
|
||
import com.spun.util.io.FileUtils; | ||
|
||
import java.io.File; | ||
|
||
import static org.approvaltests.ApprovedFileLog.APPROVAL_TEMP_DIRECTORY; | ||
|
||
public class FailedFileLog | ||
{ | ||
static | ||
{ | ||
FileUtils.writeFile(get(), ""); | ||
} | ||
public static File get() | ||
{ | ||
File file = new File(APPROVAL_TEMP_DIRECTORY + "/.failed_comparison.log"); | ||
FileUtils.createIfNeeded(file.getAbsolutePath()); | ||
return file; | ||
} | ||
public static void log(File received, File approved) | ||
{ | ||
File log = get(); | ||
FileUtils.appendToFile(log, String.format("%s -> %s\n", received.getAbsolutePath(), approved.getAbsolutePath())); | ||
} | ||
|
||
public static void touch() { | ||
// Allows static initializer to be called | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters