Package de.skuzzle.test.snapshots
Interface SnapshotDsl.Snapshot
-
- All Superinterfaces:
SnapshotDsl.ChooseActual,SnapshotDsl.ChooseDirectory,SnapshotDsl.ChooseName
- Enclosing interface:
- SnapshotDsl
@API(status=STABLE) public static interface SnapshotDsl.Snapshot extends SnapshotDsl.ChooseActual, SnapshotDsl.ChooseName, SnapshotDsl.ChooseDirectory
Allows to do snapshot assertions. An instance of this class can be injected into your test case by just specifying a parameter of this type:@Test void test(Snapshot snapshot) throws Exception { ... snapshot.assertThat(...)... }Note that the respective test class must be annotated withEnableSnapshotTests, otherwise the test framework will not be able to resolve theSnapshotparameter of the test method.Note that the Snapshot instance that is being injected into your test is stateful and not thread safe. You should also refrain from using incomplete DSL usages. You should always end the DSL call chain with any of the terminal operations
SnapshotDsl.ChooseAssertions.disabled(),SnapshotDsl.ChooseAssertions.matchesAccordingTo(StructuralAssertions),SnapshotDsl.ChooseAssertions.matchesSnapshotText()orSnapshotDsl.ChooseStructure.matchesSnapshotStructure().Each method in the DSL advances the Snapshot instance's internal state until a terminal operation has been called. So it is illegal to reuse DSL stages that have already been completed like in this example:
snapshot.assertThat(actual); snapshot.assertThat(actual);
This snippet does not only use two incomplete usages, but also tries to re-use the 'choose-actual' stage without having called er terminaly operation.- Author:
- Simon Taddiken
- See Also:
EnableSnapshotTests
-
-
Method Summary
-
Methods inherited from interface de.skuzzle.test.snapshots.SnapshotDsl.ChooseActual
assertThat
-
Methods inherited from interface de.skuzzle.test.snapshots.SnapshotDsl.ChooseDirectory
in
-
Methods inherited from interface de.skuzzle.test.snapshots.SnapshotDsl.ChooseName
named, namedAccordingTo
-
-