-
Notifications
You must be signed in to change notification settings - Fork 0
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
26 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1,21 @@ | ||
# Extend with another baseline format | ||
[TODO] | ||
|
||
You can extend [AbstractBaselineAssertion](../src/main/java/io/github/goatfryed/assert_baseline/core/AbstractBaselineAssertion.java) | ||
to implement your own format. | ||
|
||
Compare [JsonBaselineAssertion](../src/main/java/io/github/goatfryed/assert_baseline/json/JsonBaselineAssertion.java) | ||
|
||
(!) This internal API is considered unstable. | ||
|
||
## Extending from AbstractBaselineAssertion | ||
|
||
### 1. implement write | ||
Implement `AbstractBaselineAssertion::saveActual(BaselineContext)`. | ||
Serialize your subject and write it to `BaselineContext::getActualOutputStream` | ||
|
||
### 2. implement verification | ||
Implement `verifyIsEqualToBaseline(BaselineContext context)`. | ||
Usually, you'll want to read from `BaselineContext::getBaselineAsString(), deserialize the baseline, | ||
and then compare the java beans. | ||
|
||
### implement further conventional methods |
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