For normal unit tests we would just do something like (assuming Spock)
class MySpec extends Specification {
def project = ProjectBuilder.builder().build()
def "some test"() {
given:
project.apply' my.plugin'
// Rest of test
}
But about a plugin that is used in a initscript. In this case it is something that is extending Plugin<Gradle>
. How does one get an instance of Gradle to apply this to?