update tests

This commit is contained in:
nightwing 2013-07-04 14:42:40 +04:00
commit bbe87e41fa
2 changed files with 11 additions and 1 deletions

View file

@ -86,7 +86,7 @@ exports.moduleUrl = function(name, component) {
base = base.replace(re, ""); base = base.replace(re, "");
} }
if (!base && parts.length > 1) if ((!base || base == component) && parts.length > 1)
base = parts[parts.length - 2]; base = parts[parts.length - 2];
var path = options[component + "Path"]; var path = options[component + "Path"];
if (path == null) { if (path == null) {

View file

@ -60,6 +60,16 @@ module.exports = {
url = config.moduleUrl("foo/1", "theme"); url = config.moduleUrl("foo/1", "theme");
assert.equal(url, "a/b1.js"); assert.equal(url, "a/b1.js");
url = config.moduleUrl("snippets/js");
assert.equal(url, "a/b/snippets/js.js");
config.setModuleUrl("snippets/js", "_.js");
url = config.moduleUrl("snippets/js");
assert.equal(url, "_.js");
url = config.moduleUrl("ace/ext/textarea");
assert.equal(url, "a/b/ext-textarea.js");
assert.equal(); assert.equal();
}, },
"test: define options" : function() { "test: define options" : function() {