-
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
1 parent
6f3e863
commit 0feac60
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...valtests-tests/src/test/java/org/approvaltests/ApprovalsDuplicateVerifyExceptionTest.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,13 @@ | ||
package org.approvaltests; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class ApprovalsDuplicateVerifyExceptionTest { | ||
|
||
@Test | ||
void testExceptionMessage() { | ||
Approvals.verify(new ApprovalsDuplicateVerifyException("file.txt")); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...org/approvaltests/ApprovalsDuplicateVerifyExceptionTest.testExceptionMessage.approved.txt
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,11 @@ | ||
org.approvaltests.ApprovalsDuplicateVerifyException: Already approved: file.txt | ||
By default, ApprovalTests only allows one verify() call per test. | ||
To find out more, visit: | ||
https://github.com/approvals/ApprovalTests.Java/blob/master/approvaltests/docs/reference/Naming.md | ||
|
||
# Fixes | ||
1. separate your test into two tests | ||
2. add NamedParameters with the NamerFactory | ||
3. Override Approvals.settings() with either | ||
a. allowMultipleVerifyCallsForThisClass | ||
b. allowMultipleVerifyCallsForThisMethod |
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