Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
starting to test-drive the working env development
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var file = require("file"); | ||
|
||
// this is ugly. | ||
var currentPaths = require.loader.getPaths(); | ||
var newPaths = [file.cwd()].concat(currentPaths); | ||
require.loader.setPaths(newPaths); | ||
|
||
var testing = require("getjs/testing"); | ||
var workingenv = require("getjs/workingenv"); | ||
var log = require("getjs/logger").log; | ||
|
||
var testdata = new file.Path("testdata"); | ||
|
||
if (!testdata.exists()) { | ||
log.debug("Creating new directory: " + testdata.path); | ||
testdata.mkdirs(); | ||
} else { | ||
log.debug("Recreating directory: " + testdata.path); | ||
testdata.rmtree(); | ||
testdata.mkdirs(); | ||
} | ||
|
||
testing.run({ | ||
testCreateNew: function() { | ||
var we = new workingenv.WorkingEnv(testdata); | ||
var metadatadir = testdata.join(".getjs"); | ||
testing.truthy(metadatadir.exists(), ".getjs directory should be there"); | ||
} | ||
}); | ||
|