final ScriptPluginFactory scriptPluginFactory = context.mock(ScriptPluginFactory.class);
final ScriptPlugin configurer = context.mock(ScriptPlugin.class);
final ScriptSource initScriptMock = context.mock(ScriptSource.class);
final GradleInternal gradleMock = context.mock(GradleInternal.class);
context.checking(new Expectations() {{
one(scriptPluginFactory).create(initScriptMock);
will(returnValue(configurer));
one(configurer).setClasspathClosureName("initscript");
one(configurer).setScriptBaseClass(InitScript.class);