Permalink
Browse files

fixed #8

  • Loading branch information...
1 parent c3b1a6c commit b43e8d5a4c9f1c8ee2cb9c4f86a981fa3d626389 @danwrong committed Jan 15, 2012
Showing with 9 additions and 13 deletions.
  1. +1 −1 Makefile
  2. +0 −10 lib/loadbuilder/asset.js
  3. +1 −1 test/asset.js
  4. +6 −0 test/builder.js
  5. +1 −1 test/modules/named.js
View
@@ -1,2 +1,2 @@
test_all:
- NODE_PATH=./src `npm bin`/expresso -g test/*.js
+ NODE_PATH=./lib `npm bin`/expresso -g test/*.js
@@ -23,11 +23,6 @@ util.extend(Script.prototype, {
var usings, dependencies = [];
- if(dependencyCache[this.id]) {
- // Make sure it's not out of date
- console.log(dependencyCache[this.id]);
- }
-
if (!dependencyCache[this.id]) {
usings = analyzer.analyze(USING, this.fromFile());
@@ -194,12 +189,7 @@ util.extend(Module.prototype, {
// TODO make this nice - maybe have a transform function?
if (analyzer.match(STRING_ARG, provide.values[0][0]) == null) {
provide.parent[provide.index][2].unshift(['string', this.id]);
- } else {
- console.log("string thing is null");
}
- } else {
- console.log("provides.length is zero", provides.length);
- console.log(JSON.stringify(provides));
}
return uglify.uglify.gen_code(tree, { beautify: true });
View
@@ -42,7 +42,7 @@ module.exports = {
path: '/modules'
});
- assert.equal('provide("shindig", function(exports) {\n exports("hi");\n});', a.toSource());
+ assert.equal('provide("named", function(exports) {\n exports("hi");\n});', a.toSource());
},
testShouldFindDependenciesForModule: function() {
var a = new asset.Module('has_dep');
View
@@ -57,5 +57,11 @@ module.exports = {
assert.equal("alert('hello world');\nalert('hello world again');",fs.readFileSync(path, 'utf8'));
fs.unlinkSync(path);
});
+ },
+ testShouldBeAbleToSuccessFullyLoadANamedModule: function() {
+ assert.equal(
+ "provide(\"named\", function(exports) {\n exports(\"hi\");\n});",
+ builder(opts).include('modules/named').toSource()
+ );
}
};
@@ -1,3 +1,3 @@
-provide('shindig', function(exports) {
+provide('named', function(exports) {
exports('hi');
});

0 comments on commit b43e8d5

Please sign in to comment.