JavaScriptStackSource stackSource = mockJavaScriptStackSource();
JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
trainForCoreStack(linker, stackSource, pathConstructor);
JavaScriptStack child = mockJavaScriptStack();
JavaScriptStack parent = mockJavaScriptStack();
StylesheetLink parentStylesheetLink = new StylesheetLink("parent.css");
StylesheetLink childStylesheetLink = new StylesheetLink("child.css");
expect(stackSource.getStack("child")).andReturn(child);
expect(child.getStacks()).andReturn(Arrays.asList("parent"));
expect(stackSource.getStack("parent")).andReturn(parent);
expect(pathConstructor.constructPathsForJavaScriptStack("parent")).andReturn(Arrays.asList("parent.js"));
expect(parent.getStylesheets()).andReturn(Arrays.asList(parentStylesheetLink));
expect(parent.getInitialization()).andReturn("parentInit();");
expect(pathConstructor.constructPathsForJavaScriptStack("child")).andReturn(Arrays.asList("child.js"));
expect(child.getStylesheets()).andReturn(Arrays.asList(childStylesheetLink));
expect(child.getInitialization()).andReturn("childInit();");
expect(parent.getStacks()).andReturn(Collections.<String> emptyList());
linker.addScriptLink("parent.js");
linker.addScriptLink("child.js");
linker.addStylesheetLink(parentStylesheetLink);