Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 11CF718913 for ; Wed, 7 Oct 2015 05:28:05 +0000 (UTC) Received: (qmail 61877 invoked by uid 500); 7 Oct 2015 05:28:05 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 61848 invoked by uid 500); 7 Oct 2015 05:28:05 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 61829 invoked by uid 99); 7 Oct 2015 05:28:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Oct 2015 05:28:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 60D6CE03B4; Wed, 7 Oct 2015 05:28:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Date: Wed, 07 Oct 2015 05:28:05 -0000 Message-Id: <01eac73ae8f749348f86cd9e22b60b1d@git.apache.org> In-Reply-To: <7bcc35e7ded04fea934e1a586ef57f74@git.apache.org> References: <7bcc35e7ded04fea934e1a586ef57f74@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] cordova-lib git commit: CB-9589 added test to check id conversion CB-9589 added test to check id conversion Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/1c0810a8 Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/1c0810a8 Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/1c0810a8 Branch: refs/heads/master Commit: 1c0810a86d6a946d75220271125d455759fb90e7 Parents: a7287ce Author: Steve Gill Authored: Fri Oct 2 19:08:16 2015 -0700 Committer: Steve Gill Committed: Tue Oct 6 17:40:12 2015 -0700 ---------------------------------------------------------------------- cordova-lib/spec-plugman/install.spec.js | 14 ++++++++++++++ cordova-lib/src/plugman/fetch.js | 1 - cordova-lib/src/plugman/uninstall.js | 16 ++++++++-------- 3 files changed, 22 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c0810a8/cordova-lib/spec-plugman/install.spec.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/install.spec.js b/cordova-lib/spec-plugman/install.spec.js index e8a3cd5..572ffde 100644 --- a/cordova-lib/spec-plugman/install.spec.js +++ b/cordova-lib/spec-plugman/install.spec.js @@ -227,6 +227,20 @@ describe('install', function() { expect(fetchSpy).toHaveBeenCalled(); }); }); + it('should call fetch and convert oldID to newID', function() { + fetchSpy.andReturn( Q( plugins['org.test.plugins.dummyplugin'] ) ); + spyOn(fs, 'existsSync').andCallFake( fake['existsSync']['noPlugins'] ); + var emit = spyOn(events, 'emit'); + runs(function() { + installPromise(install('android', project, 'org.apache.cordova.device' )); + }); + waitsFor(function() { return done; }, 'install promise never resolved', 200); + runs(function() { + expect(emit.calls[0].args[1]).toBe('Notice: org.apache.cordova.device has been automatically converted to cordova-plugin-device and fetched from npm. This is due to our old plugins registry shutting down.'); + expect(done).toBe(true); + expect(fetchSpy).toHaveBeenCalled(); + }); + }); describe('engine versions', function () { var fail, satisfies; http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c0810a8/cordova-lib/src/plugman/fetch.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/plugman/fetch.js b/cordova-lib/src/plugman/fetch.js index ad511e4..33e36ed 100644 --- a/cordova-lib/src/plugman/fetch.js +++ b/cordova-lib/src/plugman/fetch.js @@ -180,7 +180,6 @@ function checkID(expectedIdAndVersion, pinfo) { } } - // Note, there is no cache invalidation logic for local plugins. // As of this writing loadLocalPlugins() is never called with different // search paths and such case would not be handled properly. http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c0810a8/cordova-lib/src/plugman/uninstall.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/plugman/uninstall.js b/cordova-lib/src/plugman/uninstall.js index 3771c1b..7251d35 100644 --- a/cordova-lib/src/plugman/uninstall.js +++ b/cordova-lib/src/plugman/uninstall.js @@ -148,14 +148,14 @@ module.exports.uninstallPlugin = function(id, plugins_dir, options) { var splitVersion = d.id.split('@'); deps_path = path.join(plugin_dir, '..', splitVersion[0]); if (!fs.existsSync(deps_path)) { - var newId = pluginMapper[splitVersion[0]]; - if (newId && toDelete.indexOf(newId) === -1) { - toDelete.push(newId); - findDependencies(newId); - } + var newId = pluginMapper[splitVersion[0]]; + if (newId && toDelete.indexOf(newId) === -1) { + toDelete.push(newId); + findDependencies(newId); + } } else if (toDelete.indexOf(d.id) === -1) { - toDelete.push(d.id); - findDependencies(d.id); + toDelete.push(d.id); + findDependencies(d.id); } }); } @@ -277,7 +277,7 @@ function runUninstallPlatform(actions, platform, project_dir, plugin_dir, plugin var opts = underscore.extend({}, options, { is_top_level: depsInfo.top_level_plugins.indexOf(dangler) > -1, - depsInfo: depsInfo + depsInfo: depsInfo }); return runUninstallPlatform(actions, platform, project_dir, dependent_path, plugins_dir, opts); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org