Skip to content

Commit

Permalink
starting to test-drive the working env development
Browse files Browse the repository at this point in the history
  • Loading branch information
dangoor committed Apr 15, 2009
1 parent 5463119 commit ac8090d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/getjs/tests/test_workingenv.js
@@ -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");
}
});

0 comments on commit ac8090d

Please sign in to comment.