> Not really. But they could be, with some tidy-up.
>
> For Gradle, we have 2 types of tests for plugins:
>
> 1. The test uses a fixture to create a Project instance, which the test
> drives programmatically eg
>
> @Test pluginDoesSomeStuff() {
>    Project project = createRootProject()
>    project.apply type: MyCustomPlugin
>
>    // Make some assertions about what the plugin has done to the project
> }
>
> 2. The test uses a fixture to execute a Gradle build. There are 2
> implementations: one uses the GradleLauncher API to run the build in
> process, and one forks the gradle command to run the build in a child
> process. E.g:
>
> @Test pluginDoesSomeStuff() {
>    File buildFile = ...
>    buildFile << '''
>    apply type: MyCustomPlugin
>    // maybe some other stuff
> '''
>
>    executer.usingBuildFile(buildFile).withTasks('someTask').run()
>
>    // make some assertions about what the build has done
> }
>
>
> Is this the sort of thing you had in mind?

Yes. I think a combination of both would probably be ideal.

Cheers,

Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to