Hi,
Probably a quick question:
I wrote some tests for the plugin I'm working on. The plugin calls some
methods in the afterEvaluate closure. This works fine, when I use the plugin
in my project.
In my testcase however, it seems that the afterEvaluate closure doesn't get
called and therefore my testcase fails verifying some of the properties that
are set by one of the called methods.
Here is the part that currently fails for me:
project = ProjectBuilder.builder().build()
def "FLEXHOME is not provided"(Project project) {
project.plugins.apply(GradleFxPlugin)
GradleFxPlugin plugin = project.plugins.getPlugin(GradleFxPlugin)
expect:
! plugin.isFlexHomeProvided()
// TODO: why is there no ant.properties collection available?
afterEvaluate doesn't get called during the testrun
project.ant.properties['FLEX_HOME'] ==
plugin.flexSDKLocalCacheDir('4.5.1.21328')
where:
project << createProjectWithoutFlexHome()
}
Is there a better approach to test the project configuration, when the
properties are added by a method that gets called in afterEvaluate?
Thanks,
Ingo
--
San Francisco Blog <http://8880km.blogspot.com>
"today is tomorrows past blog" <http://ingorichter.blogspot.com>
LinkedIn Profile: <http://www.linkedin.com/in/ingorichter>
twitter: <http://twitter.com/ingorichter>