From bbe87e41fa3fb4c79724310ed60017f4f0f283bb Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 4 Jul 2013 14:42:40 +0400 Subject: [PATCH] update tests --- lib/ace/config.js | 2 +- lib/ace/config_test.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ace/config.js b/lib/ace/config.js index 606a1e57..eb3de049 100644 --- a/lib/ace/config.js +++ b/lib/ace/config.js @@ -86,7 +86,7 @@ exports.moduleUrl = function(name, component) { base = base.replace(re, ""); } - if (!base && parts.length > 1) + if ((!base || base == component) && parts.length > 1) base = parts[parts.length - 2]; var path = options[component + "Path"]; if (path == null) { diff --git a/lib/ace/config_test.js b/lib/ace/config_test.js index 0e4f5449..d09a2801 100644 --- a/lib/ace/config_test.js +++ b/lib/ace/config_test.js @@ -60,6 +60,16 @@ module.exports = { url = config.moduleUrl("foo/1", "theme"); 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(); }, "test: define options" : function() {