KatachiKonsistNoExpectationException
A konsist { } block that asked for nothing.
A block that queries Konsist and never ends the query with KonsistScope.must, KonsistScope.mustNot or KonsistScope.mustBeEmpty rejects nothing, which is indistinguishable from a rule everything satisfies. Since this backend can count its own expectations, it says so instead of returning a green answer nobody asked for.
Example 1: catch a block that forgot to say what it wants
val failure = shouldThrow<KatachiArchitectureAssertionError> {
projectArchitecture.assert(FileConstraintCheck())
}
failure.violations.filterIsInstance<UncheckedFileConstraint>()
.single().cause.shouldBeInstanceOf<KatachiKonsistNoExpectationException>()Content copied to clipboard