Gradle plugin unit tests verifying buildscan configuration

I’m trying to write a unit test for a custom plugin that will verify the custom tags/values/links that I’m creating in the plugin class.

Does anybody have an example of something like this? Ideally, I’d like a Spock specification, but I’ll take what I can get.

I often add a “performAssertions” task to the test build script where I run the actual assertions in the Gradle jvm rather than spock’s jvm. Much easier than marshalling values between the two. Perhaps you could do similar.

Eg: