@Test public void testFound() { makeTargetFindable(); fakeResource(spec); given(resourceFinder.loadResource(ScriptResource.class, AppBase, specName)).willReturn(spec); given(pathResolver.specLocationFor(AppBase)).willReturn(AppBase); JasmineScriptEnvironment jse = new JasmineScriptEnvironment( dependencies, global, resourceFinder, pathResolver, makeResourceLoaded(target)); assertThat(jse.name(), is(specName)); assertThat(jse.script(), is(jasmineBootScript)); verifyDependentSetup(jasmine, jse); verifyDependentSetup(jasmineBoot, jse); verifyDependentSetup(jasmineRun, jse); verifyDependentSetup(target, jse); verifyDependentSetup(spec, jse); // make sure we ran our setup (at least the part that matters internally) verify(dependencies.mockRhinoContextProvider().context).executeScript(jasmineScript, global); // TODO VERIFY THE SCOPE! // need some test tools for this // and need to tweak down the scope anyway. it's not right, yet. // inject needs to be renamed // require needs to be renamed // verify the sha is build from all our script buddies. kind of goofy but correct // this is sort of future-prep but this might become a target for socket connections at // some point, to deliver test run results to the browser. maybe assertThat(jse.sha1(), is("4a117d7e27db77e337750a4e380ef4587be12f40")); }