Some sugar for integrating Okeydoke and Minutest: ...
# minutest
n
Some sugar for integrating Okeydoke and Minutest:
Copy code
fun Context<Unit, Approver>.approvingYaml() {
    fixtureInstrumented { test ->
        Approver(
            test.fullName().joinToString("/"),
            FileSystemSourceOfApproval(
                File("src/test/resources"),
                Reporters.fileSystemReporter())
                .withTypeExtension(".yml"),
            Formatter(yaml::writeValueAsString),
            Serializers.stringSerializer(),
            Checkers.stringChecker()
        )
    }
}


fun TestContext<Approver>.approve(name: String, fn: () -> Any) {
    test(name) {
        assertApproved(fn())
    }
}
Used like:
Copy code
val `a context` = context<Approver> {
    approvingYaml()
    
    approve("an approval test") {
        TheThingToBeApproved(andSomeArguments)
    }
}