@Test public void appsDirNextToSdkIsUsedIfWorkingDirIsBrjsDir() throws Exception { secondaryTempFolder = org.bladerunnerjs.utility.FileUtils.createTemporaryDirectory(BRJSTest.class); given(brjs).hasBeenCreated(); when(brjs.app("app1")).create(); then(testRootDirectory).containsDir("apps/app1"); }
@Test public void workingDirIsusedIfNoOtherDirectoryCanBeFoundToUseForApps() throws Exception { secondaryTempFolder = org.bladerunnerjs.utility.FileUtils.createTemporaryDirectory(BRJSTest.class); given(brjs).hasBeenCreatedWithWorkingDir(secondaryTempFolder); when(brjs.app("app1")).create(); then(secondaryTempFolder).containsDir("app1"); }
@Test public void appsFolderInTheParentOfTheWorkingDirIsUsedIfNextToSdk() throws Exception { secondaryTempFolder = org.bladerunnerjs.utility.FileUtils.createTemporaryDirectory(BRJSTest.class); given(secondaryTempFolder) .containsFolder("apps/dir1/dir2/dir3") .and(secondaryTempFolder) .containsFolder("sdk") .and(brjs) .hasBeenCreatedWithWorkingDir(new File(secondaryTempFolder, "apps/dir1/dir2/dir3")); when(brjs.app("app1")).create(); then(secondaryTempFolder).containsDir("apps/app1"); }