cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [19/51] [partial] cordova-lib git commit: Reorganized unit test directory. Changes include: - consolidate spec-cordova/ and spec-plugman/ into a single spec/ dir. - put jasmine config and helper modules in top-level spec dir. - changed package.json npm r
Date Tue, 27 Jun 2017 21:22:00 GMT
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/metadata/webos_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/metadata/webos_parser.spec.js b/spec-cordova/metadata/webos_parser.spec.js
deleted file mode 100755
index 4641339..0000000
--- a/spec-cordova/metadata/webos_parser.spec.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-var webosParser = require('../../src/cordova/metadata/webos_parser'),
-    util = require('../../src/cordova/util'),
-    path = require('path'),
-    shell = require('shelljs'),
-    fs = require('fs'),
-    config = require('../../src/cordova/config'),
-    ConfigParser = require('cordova-common').ConfigParser;
-
-var cfg = new ConfigParser(path.join(__dirname, '..', 'test-config.xml'));
-describe('webos project parser', function() {
-    var proj = path.join('some', 'path');
-    var exists, exec, custom;
-    beforeEach(function() {
-        exists = spyOn(fs, 'existsSync').and.returnValue(true);
-        exec = spyOn(shell, 'exec').and.callFake(function(cmd, opts, cb) {
-            cb(0, '');
-        });
-        custom = spyOn(config, 'has_custom_path').and.returnValue(false);
-    });
-
-    describe('constructions', function() {
-        it('should create an instance with a path', function() {
-            expect(function() {
-                var p = new webosParser(proj);
-                expect(p.path).toEqual(proj);
-            }).not.toThrow();
-        });
-    });
-
-    describe('instance', function() {
-        var p, cp, rm, is_cordova, write, read;
-        var wos_proj = path.join(proj, 'platforms', 'webos');
-        beforeEach(function() {
-            p = new webosParser(wos_proj);
-            cp = spyOn(shell, 'cp');
-            rm = spyOn(shell, 'rm');
-            is_cordova = spyOn(util, 'isCordova').and.returnValue(proj);
-            write = spyOn(fs, 'writeFileSync');
-            read = spyOn(fs, 'readFileSync').and.returnValue('');
-        });
-
-        describe('update_from_config method', function() {
-            beforeEach(function() {
-                cfg.name = function() { return 'testname'; };
-                cfg.packageName = function() { return 'testpkg'; };
-                cfg.version = function() { return '1.0'; };
-            });
-
-          /*  it('should write appinfo.json', function() {
-                //p.update_from_config(cfg);
-                //expect(write.mostRecentCall.args[0]).toEqual('appinfo.json');
-            });*/
-        });
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/platform/addHelper.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/platform/addHelper.spec.js b/spec-cordova/platform/addHelper.spec.js
deleted file mode 100644
index 8218d91..0000000
--- a/spec-cordova/platform/addHelper.spec.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    http://www.apache.org/licenses/LICENSE-2.0
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-/* eslint-env jasmine */
-
-describe('cordova/platform/addHelper', function () {
-    describe('error/warning conditions', function () {
-        it('should require specifying at least one platform');
-        it('should warn if host OS does not support the specified platform');
-    });
-    describe('happy path (success conditions)', function () {
-        it('should fire the before_platform_* hook');
-        it('should warn about deprecated platforms');
-        /*
-         * first "leg" (`then`) of the promise is platform "spec" support:
-         * - tries to infer spec from either package.json or config.xml
-         * - defaults to pinned version for platform.
-         * - downloads the platform, passing in spec.
-         * --> how to test: spy on downloadPlatform, validate spec passed.
-         * --> should mock out downloadPlatform completely for all happy path tests. this would short-circuit the first addHelper promise `then`.
-         * second "leg" (`then`) of the promise:
-         * - checks for already-added or not-added platform requirements. TODO: couldnt we move this up to before downloading, to the initial error/warning checks?
-         * - invokes platform api createPlatform or updatePlatform
-         * - if not restoring, runs a `prepare`
-         * - if just added, installsPluginsForNewPlatform (TODO for fil: familiarize yourself why not just a regular "install plugin for platform" - why the 'newPlatform' API?)
-         * - if not restoring, run a prepare. TODO: didnt we just do this? we just installed plugins, so maybe its needed, but couldnt we just run a single prepare after possibly installing plugins?
-         * third `then`:
-         * - save particular platform version installed to platform metadata.
-         * - if autosaving or opts.save is provided, write platform to config.xml
-         * fourth `then`:
-         * - save added platform to package.json if exists.
-         * fifth `then`:
-         * - fire after_platform_add/update hook
-         */
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/platform/index.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/platform/index.spec.js b/spec-cordova/platform/index.spec.js
deleted file mode 100644
index a39d43e..0000000
--- a/spec-cordova/platform/index.spec.js
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    http://www.apache.org/licenses/LICENSE-2.0
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-// TODO: remove these once eslint lands
-/* eslint-env jasmine */
-/* globals fail */
-
-var rewire = require('rewire');
-var platform = rewire('../../src/cordova/platform');
-var cordova_util = require('../../src/cordova/util');
-
-describe('cordova/platform', function () {
-    var hooksRunnerRevert;
-    var projectRoot = 'somepath';
-    beforeEach(function () {
-        // TODO: if we can change HooksRunner from a prototypal class to a function or object,
-        // we could eliminate the need for rewire here and use just jasmine spies.
-        hooksRunnerRevert = platform.__set__('HooksRunner', function () {});
-        spyOn(cordova_util, 'cdProjectRoot').and.returnValue(projectRoot);
-    });
-
-    afterEach(function () {
-        hooksRunnerRevert();
-    });
-
-    describe('main module function', function () {
-        describe('error/warning conditions', function () {
-            // TODO: what about other commands? update? save?
-            it('should require at least one platform for add and remove commands', function (done) {
-                // targets = empty array
-                platform('add', []).then(function () {
-                    fail('should not succeed without targets');
-                }, function (err) {
-                    expect(err).toMatch(/You need to qualify.* with one or more platforms/gi);
-                }).then(function () {
-                    // targets = null
-                    return platform('remove', null);
-                })
-                .then(function () {
-                    fail('should not succeed without targets');
-                }, function (err) {
-                    expect(err).toMatch(/You need to qualify.* with one or more platforms/gi);
-                }).done(done);
-            });
-        });
-        describe('handling of targets parameter', function () {
-            var cmd = 'add';
-            beforeEach(function () {
-                spyOn(platform, cmd).and.returnValue(true);
-            });
-            it('should be able to handle an array of platform targets', function (done) {
-                var targets = ['nokia brick', 'HAM radio', 'nintendo wii'];
-                platform(cmd, targets)
-                .then(function () {
-                    expect(platform[cmd]).toHaveBeenCalledWith(jasmine.any(Object), projectRoot, targets, jasmine.any(Object));
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).done(done);
-            });
-            it('should be able to handle a single platform target string', function (done) {
-                var target = 'motorola razr';
-                platform(cmd, target)
-                .then(function () {
-                    expect(platform[cmd]).toHaveBeenCalledWith(jasmine.any(Object), projectRoot, [target], jasmine.any(Object));
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).done(done);
-            });
-        });
-        describe('happy path (success conditions)', function () {
-            it('should direct `add` commands to the `add` method/module', function (done) {
-                spyOn(platform, 'add').and.returnValue(true);
-                platform('add', ['android'])
-                .then(function () {
-                    expect(platform.add).toHaveBeenCalled();
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).done(done);
-            });
-            it('should direct `remove` + `rm` commands to the `remove` method/module', function (done) {
-                spyOn(platform, 'remove').and.returnValue(true);
-                platform('remove', ['android'])
-                .then(function () {
-                    expect(platform.remove).toHaveBeenCalled();
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).then(function () {
-                    platform.remove.calls.reset(); // reset spy counter
-                    return platform('rm', ['android']);
-                }).then(function () {
-                    expect(platform.remove).toHaveBeenCalled();
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).done(done);
-            });
-            it('should direct `update` + `up` commands to the `update` method/module', function (done) {
-                spyOn(platform, 'update').and.returnValue(true);
-                platform('update', ['android'])
-                .then(function () {
-                    expect(platform.update).toHaveBeenCalled();
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).then(function () {
-                    platform.update.calls.reset(); // reset spy counter
-                    return platform('up', ['android']);
-                }).then(function () {
-                    expect(platform.update).toHaveBeenCalled();
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).done(done);
-            });
-            it('should direct `check` commands to the `check` method/module', function (done) {
-                spyOn(platform, 'check').and.returnValue(true);
-                platform('check', ['android'])
-                .then(function () {
-                    expect(platform.check).toHaveBeenCalled();
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).done(done);
-            });
-            it('should direct `save` commands to the `save` method/module', function (done) {
-                spyOn(platform, 'save').and.returnValue(true);
-                platform('save', ['android'])
-                .then(function () {
-                    expect(platform.save).toHaveBeenCalled();
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).done(done);
-            });
-            it('should direct `list`, all other commands and no command at all to the `list` method/module', function (done) {
-                spyOn(platform, 'list').and.returnValue(true);
-                // test the `list` command directly
-                platform('list')
-                .then(function () {
-                    expect(platform.list).toHaveBeenCalled();
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).then(function () {
-                    platform.list.calls.reset(); // reset spy counter
-                    // test the list catch-all
-                    return platform('please give me the list command');
-                }).then(function () {
-                    expect(platform.list).toHaveBeenCalled();
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).then(function () {
-                    platform.list.calls.reset(); // reset spy counter
-                    // test the lack of providing an argument.
-                    return platform();
-                }).then(function () {
-                    expect(platform.list).toHaveBeenCalled();
-                }).fail(function (e) {
-                    expect(e).toBeUndefined();
-                    fail('did not expect fail handler to be invoked');
-                }).done(done);
-            });
-        });
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/platform/platform.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/platform/platform.spec.js b/spec-cordova/platform/platform.spec.js
deleted file mode 100644
index 984ff99..0000000
--- a/spec-cordova/platform/platform.spec.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    http://www.apache.org/licenses/LICENSE-2.0
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-/* eslint-env jasmine */
-
-var os = require('os');
-var Q = require('q');
-var platform = require('../../src/cordova/platform');
-
-describe('cordova.platform', function () {
-    // TODO: all these tests below can be moved to addHelper.spec.js, under the "it should require specifying at least one platform" test.
-    describe('add function', function () {
-        var opts;
-        var hooksRunnerMock;
-        var projectRoot = os.tmpdir();
-
-        beforeEach(function () {
-            opts = {};
-            hooksRunnerMock = {
-                fire: function () {
-                    return Q();
-                }
-            };
-        });
-
-        it('Test 004 : throws if the target list is empty', function (done) {
-            var targets = [];
-            platform.add(hooksRunnerMock, projectRoot, targets, opts).fail(function (error) {
-                expect(error.message).toBe('No platform specified. Please specify a platform to add. See `cordova platform list`.');
-                done();
-            });
-        });
-
-        it('Test 005 : throws if the target list is undefined or null', function (done) {
-            // case 1 : target list undefined
-            var targets; // = undefined;
-            platform.add(hooksRunnerMock, projectRoot, targets, opts).fail(function (error) {
-                expect(error.message).toBe('No platform specified. Please specify a platform to add. See `cordova platform list`.');
-            });
-
-            // case 2 : target list null
-            targets = null;
-            platform.add(hooksRunnerMock, projectRoot, targets, opts).fail(function (error) {
-                expect(error.message).toBe('No platform specified. Please specify a platform to add. See `cordova platform list`.');
-                done();
-            });
-        });
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/platforms/PlatformApiPoly.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/platforms/PlatformApiPoly.spec.js b/spec-cordova/platforms/PlatformApiPoly.spec.js
deleted file mode 100644
index db35d3d..0000000
--- a/spec-cordova/platforms/PlatformApiPoly.spec.js
+++ /dev/null
@@ -1,316 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-
-var Q = require('q');
-var fs = require('fs');
-var et = require('elementtree');
-var path = require('path');
-var shell = require('shelljs');
-var xmlHelpers = require('cordova-common').xmlHelpers;
-var ActionStack = require('cordova-common').ActionStack;
-var superspawn = require('cordova-common').superspawn;
-var PluginInfo = require('cordova-common').PluginInfo;
-var ConfigParser = require('cordova-common').ConfigParser;
-var knownPlatforms = require('../../src/platforms/platforms');
-var PlatformApiPoly = require('../../src/platforms/PlatformApiPoly');
-
-var PLATFORM = 'browser';
-var PLATFORM_VERSION = '4.1.0';
-var PLATFORM_LIB = '/some/platform/lib';
-var CORDOVA_ROOT = path.join(__dirname, '../fixtures/projects/platformApi');
-var PLATFORM_ROOT = path.join(CORDOVA_ROOT, 'platforms/browser');
-var DUMMY_PLUGIN = path.join(__dirname, '../fixtures/plugins/test');
-var TEST_XML = '<?xml version="1.0" encoding="UTF-8"?>\n' +
-    '<widget xmlns     = "http://www.w3.org/ns/widgets"\n' +
-    '        xmlns:cdv = "http://cordova.apache.org/ns/1.0"\n' +
-    '        id        = "io.cordova.hellocordova"\n' +
-    '        version   = "0.0.1">\n' +
-    '    <name>Hello Cordova</name>\n' +
-    '    <description>\n' +
-    '        A sample Apache Cordova application that responds to the deviceready event.\n' +
-    '    </description>\n' +
-    '    <author href="http://cordova.io" email="dev@cordova.apache.org">\n' +
-    '        Apache Cordova Team\n' +
-    '    </author>\n' +
-    '    <content src="index.html" />\n' +
-    '    <access origin="*" />\n' +
-    '    <preference name="fullscreen" value="true" />\n' +
-    '    <preference name="webviewbounce" value="true" />\n' +
-    '</widget>\n';
-
-var platformApiPolyPublicMethods = [
-    'getPlatformInfo',
-    'prepare',
-    'addPlugin',
-    'removePlugin',
-    'updatePlugin',
-    'build',
-    'run',
-    'clean',
-    'requirements'
-];
-
-describe('PlatformApi polyfill', function () {
-    var platformApi;
-
-    beforeEach(function () {
-        var originalParseElementtreeSync = xmlHelpers.parseElementtreeSync;
-        spyOn(xmlHelpers, 'parseElementtreeSync').and.callFake(function (configPath) {
-            return /config\.xml$/.test(configPath) ? new et.ElementTree(et.XML(TEST_XML)) :
-                originalParseElementtreeSync(configPath);
-        });
-
-        platformApi = new PlatformApiPoly(PLATFORM, PLATFORM_ROOT);
-    });
-
-    it('should be constructable', function () {
-        var api;
-        expect(function(){api = new PlatformApiPoly(PLATFORM, PLATFORM_ROOT);}).not.toThrow();
-        expect(api).toEqual(jasmine.any(PlatformApiPoly));
-    });
-
-    it('should fail when unknown platform is specified', function () {
-        var api;
-        expect(function(){api = new PlatformApiPoly('fakePlatform', PLATFORM_ROOT);}).toThrow();
-    });
-
-    it('should fail when mandatory argument is not specified', function () {
-        var api;
-        expect(function(){api = new PlatformApiPoly(PLATFORM);}).toThrow();
-        expect(function(){api = new PlatformApiPoly(null, PLATFORM_ROOT);}).toThrow();
-    });
-
-    it('should have fields defined', function () {
-        expect(platformApi.platform).toBe(PLATFORM);
-        expect(platformApi.root).toBe(PLATFORM_ROOT);
-    });
-
-    it('should have \'static\' methods defined', function () {
-        expect(platformApi.constructor.createPlatform).toEqual(jasmine.any(Function));
-        expect(platformApi.constructor.updatePlatform).toEqual(jasmine.any(Function));
-    });
-
-    it('should have methods defined', function () {
-        platformApiPolyPublicMethods.forEach(function (methodName) {
-            expect(platformApi[methodName]).toEqual(jasmine.any(Function));
-        });
-    });
-
-    describe('methods:', function () {
-
-        var FAKE_PROJECT, FAKE_CONFIG, OPTIONS, getPlatformApi, fail, success;
-
-        beforeEach(function () {
-            getPlatformApi = spyOn(knownPlatforms, 'getPlatformApi').and.returnValue(platformApi);
-
-            spyOn(shell, 'cp');
-            spyOn(shell, 'rm');
-            spyOn(shell, 'mkdir');
-            spyOn(fs, 'writeFileSync');
-
-            fail = jasmine.createSpy('fail');
-            success = jasmine.createSpy('success');
-
-            FAKE_CONFIG = new ConfigParser('/fake/config.xml');
-            FAKE_PROJECT = {locations: {platforms: path.dirname(PLATFORM_ROOT), www: path.join(CORDOVA_ROOT, 'www')}, projectConfig: FAKE_CONFIG};
-            OPTIONS = {platformDetails: {libDir: PLATFORM_LIB, platform: PLATFORM, version: PLATFORM_VERSION}};
-        });
-
-        describe('static create/updatePlatform methods', function () {
-            var spawn;
-
-            beforeEach(function () {
-                spawn = spyOn(superspawn, 'spawn').and.returnValue(Q());
-            });
-
-            it('should create/update platform through running platforms\' scripts', function (done) {
-                Q.all([PlatformApiPoly.createPlatform(PLATFORM_ROOT, FAKE_CONFIG, OPTIONS),
-                       PlatformApiPoly.updatePlatform(PLATFORM_ROOT, OPTIONS)])
-                .then(function () {
-                    expect(spawn).toHaveBeenCalled();
-                    expect(spawn.calls.count()).toBe(2);
-                }).fail(function (err) {
-                    expect(err).not.toBeDefined();
-                }).fin(done);
-            });
-
-            it('should pass down arguments to platforms\' scripts', function (done) {
-                Q.all([PlatformApiPoly.createPlatform(PLATFORM_ROOT, FAKE_CONFIG, OPTIONS),
-                       PlatformApiPoly.updatePlatform(PLATFORM_ROOT, OPTIONS)])
-                .then(function () {
-                    expect(spawn).toHaveBeenCalled();
-                    expect(spawn.calls.count()).toBe(2);
-                    expect(spawn.calls.argsFor(0)[0]).toBe(path.join(PLATFORM_LIB, 'bin/create'));
-                    expect(spawn.calls.argsFor(0)[1]).toContain(PLATFORM_ROOT);
-                    expect(spawn.calls.argsFor(1)[0]).toBe(path.join(PLATFORM_LIB, 'bin/update'));
-                    expect(spawn.calls.argsFor(1)[1]).toContain(PLATFORM_ROOT);
-                }).fail(function (err) {
-                    expect(err).not.toBeDefined();
-                }).fin(done);
-            });
-
-            it('should copy cordova JS sources into created platform', function (done) {
-                Q.all([PlatformApiPoly.createPlatform(PLATFORM_ROOT, FAKE_CONFIG, OPTIONS),
-                       PlatformApiPoly.updatePlatform(PLATFORM_ROOT, OPTIONS)])
-                .then(function () {
-                    expect(shell.cp).toHaveBeenCalled();
-                    expect(shell.cp.calls.count()).toBe(2);
-                }).fail(fail)
-                .fin(function () {
-                    expect(fail).not.toHaveBeenCalled();
-                    done();
-                });
-            });
-
-            it('should fail immediately if options.platformInfo is not specified', function (done) {
-                Q.all([PlatformApiPoly.createPlatform(PLATFORM_ROOT, FAKE_CONFIG),
-                       PlatformApiPoly.updatePlatform(PLATFORM_ROOT, FAKE_CONFIG)])
-                .then(success)
-                .fail(fail)
-                .fin(function function_name (argument) {
-                    expect(success).not.toHaveBeenCalled();
-                    expect(fail).toHaveBeenCalled();
-                    expect(spawn).not.toHaveBeenCalled();
-                    done();
-                });
-            });
-        });
-
-        describe('prepare method', function () {
-            beforeEach(function () {
-                spyOn(platformApi._parser, 'update_www');
-                spyOn(platformApi._parser, 'update_project').and.returnValue(Q());
-            });
-
-            it('should return promise', function (done) {
-                var promise = platformApi.prepare(FAKE_PROJECT, OPTIONS);
-                expect(Q.isPromise(promise)).toBeTruthy();
-                promise.fin(done);
-            });
-
-            it('should call parser\'s corresponding methods', function (done) {
-                platformApi.prepare(FAKE_PROJECT, OPTIONS)
-                .then(function () {
-                    [platformApi._parser.update_www, platformApi._parser.update_project]
-                    .forEach(function (method) {
-                        expect(method).toHaveBeenCalled();
-                    });
-                })
-                .fail(fail)
-                .fin(function () {
-                    expect(fail).not.toHaveBeenCalled();
-                    done();
-                });
-            });
-        });
-
-        describe('pluginAdd method', function () {
-            var plugin, actionsProcess;
-
-            beforeEach(function () {
-                plugin = new PluginInfo(DUMMY_PLUGIN);
-                actionsProcess = spyOn(ActionStack.prototype, 'process').and.callThrough();
-            });
-
-            it('should return promise', function (done) {
-                var promise = platformApi.addPlugin(plugin);
-                expect(Q.isPromise(promise)).toBeTruthy();
-                promise.fin(done);
-            });
-
-            it('should fail if plugin parameter is not specified', function (done) {
-                platformApi.addPlugin()
-                .then(success)
-                .fail(fail)
-                .fin(function () {
-                    expect(success).not.toHaveBeenCalled();
-                    expect(fail).toHaveBeenCalled();
-                    done();
-                });
-            });
-
-            it('should process all plugin files through action stack', function (done) {
-                platformApi.addPlugin(plugin)
-                .then(success)
-                .fail(fail)
-                .fin(function () {
-                    expect(actionsProcess).toHaveBeenCalled();
-                    expect(success).toHaveBeenCalled();
-                    expect(fail).not.toHaveBeenCalled();
-                    done();
-                });
-            });
-        });
-
-        describe('platform actions', function () {
-            var spawnSpy;
-
-            beforeEach(function () {
-                spawnSpy = spyOn(superspawn, 'spawn');
-            });
-
-            it('should return promise', function (done) {
-                var ops = [
-                    platformApi.build(/*opts*/),
-                    platformApi.run(/*opts*/),
-                    platformApi.clean(/*opts*/),
-                    platformApi.requirements()
-                ];
-
-                ops.forEach(function (op) {
-                    expect(Q.isPromise(op));
-                });
-                Q.all(ops).fin(done);
-            });
-
-            it('should do their job through running platforms\' scripts', function (done) {
-                var ops = [
-                    platformApi.build(/*opts*/),
-                    platformApi.run(/*opts*/),
-                    platformApi.clean(/*opts*/)
-                ];
-
-                Q.all(ops)
-                .then(function () {
-                    expect(spawnSpy).toHaveBeenCalled();
-                    expect(spawnSpy.calls.count()).toEqual(3);
-                }).fin(done);
-            });
-
-            it('should convert and pass down options to platforms\' scripts', function (done) {
-                var options = {
-                    release: true,
-                    nobuild: true,
-                    device: true,
-                    target: 'FakeDevice',
-                    archs: ['arm', 'x86'],
-                    buildConfig: '/some/path'
-                };
-                spawnSpy.and.returnValue(Q());
-                platformApi.build(options)
-                .then(function () {
-                    ['--release', '--nobuild', '--device', '--target=' + options.target, '--archs=arm,x86', '--buildConfig='  +options.buildConfig]
-                    .forEach(function (arg) {
-                        expect(spawnSpy.calls[0].args[1]).toContain(arg);
-                    });
-                }).fin(done);
-            });
-        });
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/platforms/platforms.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/platforms/platforms.spec.js b/spec-cordova/platforms/platforms.spec.js
deleted file mode 100644
index 8ab9ea2..0000000
--- a/spec-cordova/platforms/platforms.spec.js
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-
-var fs = require('fs');
-var os = require('os');
-var path = require('path');
-var rewire = require('rewire');
-var shell = require('shelljs');
-var events = require('cordova-common').events;
-
-var util = require('../../src/cordova/util');
-var platforms = rewire('../../src/platforms/platforms');
-
-var CORDOVA_ROOT = path.join(__dirname, '../fixtures/projects/platformApi');
-var PLATFORM_WITH_API = path.join(CORDOVA_ROOT, 'platforms/windows');
-var PLATFORM_SYMLINK = path.join(os.tmpdir(), 'cordova_windows_symlink');
-var PlatformApiPoly = require('../../src/platforms/PlatformApiPoly');
-
-var browserParser = require('../../src/cordova/metadata/browser_parser.js');
-
-shell.ln('-sf', PLATFORM_WITH_API, PLATFORM_SYMLINK);
-
-describe('getPlatformApi method', function () {
-    var isCordova;
-
-    beforeEach(function () {
-        // reset api cache after each spec
-        platforms.__set__('cachedApis', {});
-        isCordova = spyOn(util, 'isCordova').and.returnValue(CORDOVA_ROOT);
-    });
-
-    it('should return PlatformApi class defined by platform', function () {
-        spyOn(events, 'emit').and.returnValue(true);
-        spyOn(util, 'convertToRealPathSafe').and.callThrough();
-        spyOn(util, 'requireNoCache').and.callThrough();
-        var platformApi = platforms.getPlatformApi('windows', PLATFORM_WITH_API);
-        expect(platformApi).toBeDefined();
-        expect(platformApi.platform).toEqual('windows');
-        expect(events.emit.calls.count()).toEqual(1);
-        expect(events.emit.calls.argsFor(0)[1]).toEqual('PlatformApi successfully found for platform windows');
-        expect(util.convertToRealPathSafe.calls.count()).toEqual(1);
-        expect(util.isCordova.calls.count()).toEqual(0);
-        expect(util.requireNoCache.calls.count()).toEqual(1);
-        expect(util.requireNoCache.calls.argsFor(0)[0]).toEqual(path.join(CORDOVA_ROOT, 'platforms/windows/cordova/Api.js'));
-    });
-
-    it('should return PlatformApi polyfill if PlatformApi is not defined by platform', function () {
-        spyOn(browserParser, 'dirExists').and.returnValue(true);
-        spyOn(fs, 'existsSync').and.callFake(function(somePath) {
-            if(somePath === 'PLATFORM_WOUT_API') {
-                return true;
-            }
-            return false;
-        });
-        spyOn(events, 'emit').and.returnValue(true);
-        spyOn(util, 'convertToRealPathSafe').and.returnValue('PLATFORM_WOUT_API');
-        spyOn(util, 'requireNoCache').and.callThrough();
-        var platformApi = platforms.getPlatformApi('browser', 'PLATFORM_WOUT_API');
-        expect(platformApi).toEqual(jasmine.any(PlatformApiPoly));
-        expect(util.convertToRealPathSafe.calls.count()).toEqual(1);
-        expect(events.emit.calls.count()).toEqual(1);
-        expect(events.emit.calls.argsFor(0)[1]).toEqual('Failed to require PlatformApi instance for platform "browser". Using polyfill instead.');
-        expect(util.isCordova.calls.count()).toEqual(0);
-        expect(util.requireNoCache.calls.count()).toEqual(0);
-    });
-
-    it('should throw error if using deprecated platform', function () {
-        try {
-            platforms.getPlatformApi('android', path.join(CORDOVA_ROOT, 'platforms/android'));
-        } catch(error) {
-            expect(error.toString()).toContain('platform does not have Api.js');
-        }
-    });
-
-    it('should cache PlatformApi instance for further calls', function () {
-        var platformApi = platforms.getPlatformApi('windows', PLATFORM_WITH_API);
-        expect(platformApi.fakeProperty).not.toBeDefined();
-        platformApi.fakeProperty = 'fakeValue';
-        expect(platforms.getPlatformApi('windows', PLATFORM_WITH_API).fakeProperty).toBe('fakeValue');
-    });
-
-    it('should resolve symlinks before creating an instance', function () {
-        var platformApi = platforms.getPlatformApi('windows', PLATFORM_SYMLINK);
-        expect(platforms.getPlatformApi('windows', PLATFORM_WITH_API)).toBe(platformApi);
-    });
-
-    it('should return cached instance by symlink to project root', function () {
-        platforms.getPlatformApi('windows', PLATFORM_WITH_API).fakeProperty = 'fakeValue';
-        expect(platforms.getPlatformApi('windows', PLATFORM_SYMLINK).fakeProperty).toBe('fakeValue');
-    });
-
-    it('should succeed if called inside of cordova project w/out platformRoot param', function () {
-        var platformApi = platforms.getPlatformApi('windows');
-        expect(platformApi).toBeDefined();
-        expect(platformApi.platform).toEqual('windows');
-    });
-
-    it('should throw if called outside of cordova project w/out platformRoot param', function () {
-        isCordova.and.returnValue(false);
-        expect(function () { platforms.getPlatformApi('windows'); }).toThrow();
-    });
-
-    it('should throw for unknown platform', function () {
-        expect(function () { platforms.getPlatformApi('invalid_platform'); }).toThrow();
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/plugin/add.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin/add.spec.js b/spec-cordova/plugin/add.spec.js
deleted file mode 100644
index 2788d13..0000000
--- a/spec-cordova/plugin/add.spec.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-// TODO: remove once eslint lands
-/* eslint-env jasmine */
-/* globals fail */
-
-var Q = require('q');
-var add = require('../../src/cordova/plugin/add');
-
-describe('cordova/plugin/add', function () {
-    var projectRoot = '/some/path';
-    var hook_mock;
-    beforeEach(function () {
-        hook_mock = jasmine.createSpyObj('hooks runner mock', ['fire']);
-        hook_mock.fire.and.returnValue(Q());
-    });
-    describe('main method', function () {
-        describe('error/warning conditions', function () {
-            it('should error out if at least one plugin is not specified', function (done) {
-                add(projectRoot, hook_mock, {plugins: []}).then(function () {
-                    fail('success handler unexpectedly invoked');
-                }).fail(function (e) {
-                    expect(e.message).toContain('No plugin specified');
-                }).done(done);
-            });
-            it('should error out if any mandatory plugin variables are not provided');
-        });
-        describe('happy path', function () {
-            it('should fire the before_plugin_add hook');
-            it('should determine where to fetch a plugin from using determinePluginTarget and invoke plugman.fetch with the resolved target');
-            it('should retrieve any variables for the plugin from config.xml and provide them as cli variables only when the cli variables are not already provided via options');
-            it('should invoke plugman.install for each platform added to the project');
-            it('should save plugin variable information to package.json file (if exists)');
-            it('should overwrite plugin information in config.xml after a successful installation');
-            it('should invoke preparePlatforms if plugman.install returned a truthy value');
-            it('should fire after_plugin_add hook');
-        });
-    });
-    describe('determinePluginTarget helper method', function () {
-        it('should return the target directly if the target is pluginSpec-parseable');
-        it('should return the target directly if the target is a URL');
-        it('should return the target directly if the target is a directory');
-        it('should retrieve plugin version from package.json (if exists)');
-        it('should retrieve plugin version from config.xml as a last resort');
-        describe('with fetchOptions.save=true, writing out plugin versions retrieved from config files (either config.xml or package.json)', function () {
-            it('should write out URL-as-plugin-spec to package.json');
-            it('should write out directory-as-plugin-spec to package.json');
-        });
-        it('should return plugin version retrieved from package.json or config.xml if it is a URL');
-        it('should return plugin version retrieved from package.json or config.xml if it is a directory');
-        it('should return plugin version retrieved from package.json or config.xml if it has a scope');
-        it('should return plugin-id@plugin-version if retrieved from package.json or config.xml ');
-        describe('with no version inferred from config files or provided plugin target', function () {
-            describe('when searchpath or noregistry flag is provided', function () {
-                it('should end up just returning the target passed in');
-            });
-            describe('when registry/npm is to be used (neither searchpath nor noregistry flag is provided)', function () {
-                it('should retrieve plugin info via registry.info');
-                it('should feed registry.info plugin information into getFetchVersion');
-                it('should return the target as plugin-id@fetched-version');
-            });
-        });
-    });
-    // TODO: reorganize these tests once the logic here is understood! -filmaj
-    // TODO: rewrite the tests from integration-tests/plugin_fetch.spec.js to here.
-    describe('TODO! unit tests to replace integration-tests/plugin_fetch.spec.js', function () {
-        describe('getFetchVersion helper method', function () {
-            it('should resolve with null if plugin info does not contain engines and engines.cordovaDependencies properties');
-            it('should retrieve platform version info via getInstalledPlatformsWithVersions and feed that information into determinePluginVersionToFetch');
-        });
-        describe('determinePluginVersionToFetch helper method', function () {
-            it('should return null if no valid semver versions exist and no upperbound constraints were placed');
-        });
-        describe('getFailedRequirements helper method', function () {
-        });
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/plugin/index.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin/index.spec.js b/spec-cordova/plugin/index.spec.js
deleted file mode 100644
index 565d6f9..0000000
--- a/spec-cordova/plugin/index.spec.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-// TODO: remove once eslint lands
-/* eslint-env jasmine */
-/* globals fail */
-
-var rewire = require('rewire');
-var plugin = rewire('../../src/cordova/plugin');
-var cordova_util = require('../../src/cordova/util');
-
-describe('cordova/plugin', function () {
-    var projectRoot = '/some/path';
-    var hook_mock = function () {};
-    var hook_revert_mock;
-    beforeEach(function () {
-        hook_revert_mock = plugin.__set__('HooksRunner', hook_mock);
-        spyOn(cordova_util, 'cdProjectRoot').and.returnValue(projectRoot);
-    });
-    afterEach(function () {
-        hook_revert_mock();
-    });
-    describe('error conditions', function () {
-        // TODO: what about search cmd?
-        it('should require at least one target for add and rm commands', function (done) {
-            plugin('add', null).then(function () {
-                fail('success handler unexpectedly invoked');
-            }).fail(function (e) {
-                expect(e.message).toContain('one or more plugins');
-            }).done(done);
-        });
-    });
-    describe('handling/massaging of parameters', function () {
-        it('should be able to handle an array of targets');
-        it('should be able to handle a single string as a target');
-        it('should transform targets that start with a dash into options');
-        it('should also include targets into a plugins property on options');
-    });
-    describe('happy path', function () {
-        it('should direct "add" command to the "add" submodule');
-        it('should direct "rm" and "remove" commands to the "remove" submodule');
-        it('should direct "search" command to the "search" submodule');
-        it('should direct "save" command to the "save" submodule');
-        it('should direct "list", all other commands and no command at all to the "list" submodule');
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/plugin/list.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin/list.spec.js b/spec-cordova/plugin/list.spec.js
deleted file mode 100644
index d836418..0000000
--- a/spec-cordova/plugin/list.spec.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-// TODO: remove once eslint lands
-/* eslint-env jasmine */
-/* globals fail */
-
-var Q = require('q');
-var list = require('../../src/cordova/plugin/list');
-var plugin_util = require('../../src/cordova/plugin/util');
-
-describe('cordova/plugin/list', function () {
-    var projectRoot = '/some/path';
-    var hook_mock;
-    var fake_plugins_list = [{id: 'VRPlugin'}, {id: 'MastodonSocialPlugin'}];
-    beforeEach(function () {
-        hook_mock = jasmine.createSpyObj('hooks runner mock', ['fire']);
-        hook_mock.fire.and.returnValue(Q());
-        spyOn(plugin_util, 'getInstalledPlugins').and.returnValue(Q.resolve(fake_plugins_list));
-    });
-    it('should fire the before_plugin_ls hook', function (done) {
-        var opts = {important: 'options'};
-        list(projectRoot, hook_mock, opts).then(function () {
-            expect(hook_mock.fire).toHaveBeenCalledWith('before_plugin_ls', opts);
-        }).fail(function (e) {
-            fail('fail handler unexpectedly invoked');
-            console.error(e);
-        }).done(done);
-    });
-    it('should emit a "no plugins added" result if there are no installed plugins');
-    it('should warn if plugin list contains dependencies that are missing');
-    it('should warn if plugin list contains a plugin dependency that does not have a version satisfied');
-    it('should emit a result containing a description of plugins installed');
-    it('should fire the after_plugin_ls hook');
-    it('should resolve the promise by returning an array of plugin ids installed');
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/plugin/plugin_spec_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin/plugin_spec_parser.spec.js b/spec-cordova/plugin/plugin_spec_parser.spec.js
deleted file mode 100644
index e5224e4..0000000
--- a/spec-cordova/plugin/plugin_spec_parser.spec.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-/* eslint-env jasmine */
-
-var pluginSpec = require('../../src/cordova/plugin/plugin_spec_parser');
-
-describe('methods for parsing npm plugin packages', function () {
-    function checkPluginSpecParsing (testString, scope, id, version) {
-        var parsedSpec = pluginSpec.parse(testString);
-        expect(parsedSpec.scope).toEqual(scope);
-        expect(parsedSpec.id).toEqual(id || testString);
-        expect(parsedSpec.version).toEqual(version);
-        expect(parsedSpec.package).toEqual(scope ? scope + id : id);
-    }
-
-    it('Test 001 : should handle package names with no scope or version', function () {
-        checkPluginSpecParsing('test-plugin', null, 'test-plugin', null);
-    });
-    it('Test 002 : should handle package names with a version', function () {
-        checkPluginSpecParsing('test-plugin@1.0.0', null, 'test-plugin', '1.0.0');
-        checkPluginSpecParsing('test-plugin@latest', null, 'test-plugin', 'latest');
-    });
-    it('Test 003 : should handle package names with a scope', function () {
-        checkPluginSpecParsing('@test/test-plugin', '@test/', 'test-plugin', null);
-    });
-    it('Test 004 : should handle package names with a scope and a version', function () {
-        checkPluginSpecParsing('@test/test-plugin@1.0.0', '@test/', 'test-plugin', '1.0.0');
-        checkPluginSpecParsing('@test/test-plugin@latest', '@test/', 'test-plugin', 'latest');
-    });
-    it('Test 005 : should handle invalid package specs', function () {
-        checkPluginSpecParsing('@nonsense', null, null, null);
-        checkPluginSpecParsing('@/nonsense', null, null, null);
-        checkPluginSpecParsing('@', null, null, null);
-        checkPluginSpecParsing('@nonsense@latest', null, null, null);
-        checkPluginSpecParsing('@/@', null, null, null);
-        checkPluginSpecParsing('/', null, null, null);
-        checkPluginSpecParsing('../../@directory', null, null, null);
-        checkPluginSpecParsing('@directory/../@directory', null, null, null);
-        checkPluginSpecParsing('./directory', null, null, null);
-        checkPluginSpecParsing('directory/directory', null, null, null);
-        checkPluginSpecParsing('http://cordova.apache.org', null, null, null);
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/plugin/remove.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin/remove.spec.js b/spec-cordova/plugin/remove.spec.js
deleted file mode 100644
index ab7b572..0000000
--- a/spec-cordova/plugin/remove.spec.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-// TODO: remove this once eslint lands
-/* eslint-env jasmine */
-/* globals fail */
-
-var remove = require('../../src/cordova/plugin/remove');
-
-describe('cordova/plugin/remove', function () {
-    var projectRoot = '/some/path';
-    describe('error/warning conditions', function () {
-        it('should require that a plugin be provided', function (done) {
-            remove(projectRoot, null).then(function () {
-                fail('success handler unexpectedly invoked');
-            }).fail(function (e) {
-                expect(e.message).toContain('No plugin specified');
-            }).done(done);
-        });
-        it('should require that a provided plugin be installed in the current project');
-    });
-    describe('happy path', function () {
-        it('should fire the before_plugin_rm hook');
-        it('should call plugman.uninstall.uninstallPlatform for each platform installed in the project and for each provided plugin');
-        it('should trigger a prepare if plugman.uninstall.uninstallPlatform returned something falsy');
-        it('should call plugman.uninstall.uninstallPlugin once plugin has been uninstalled for each platform');
-        describe('when save option is provided or autosave config is on', function () {
-            it('should remove provided plugins from config.xml');
-            it('should remove provided plugins from package.json (if exists)');
-        });
-        it('should remove fetch metadata from fetch.json');
-        it('should fire the after_plugin_rm hook');
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/plugin/save.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin/save.spec.js b/spec-cordova/plugin/save.spec.js
deleted file mode 100644
index 1fb8b46..0000000
--- a/spec-cordova/plugin/save.spec.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-// TODO: remove this once eslint lands
-/* eslint-env jasmine */
-/* globals fail */
-
-var rewire = require('rewire');
-var fs = require('fs');
-var save = rewire('../../src/cordova/plugin/save');
-var cordova_util = require('../../src/cordova/util');
-
-describe('cordova/plugin/save', function () {
-    var projectRoot = '/some/path';
-    var cfg_parser_mock = function () {};
-    var cfg_parser_revert_mock;
-    var fake_plugin_list = ['VRPlugin', 'MastodonSocialPlugin'];
-    var fake_fetch_json = {'VRPlugin': {}, 'MastodonSocialPlugin': {}};
-    beforeEach(function () {
-        cfg_parser_mock.prototype = jasmine.createSpyObj('config parser protytpe mock', ['getPluginIdList', 'removePlugin']);
-        cfg_parser_mock.prototype.getPluginIdList.and.returnValue(fake_plugin_list);
-        cfg_parser_revert_mock = save.__set__('ConfigParser', cfg_parser_mock);
-        spyOn(cordova_util, 'projectConfig').and.returnValue(projectRoot + '/config.xml');
-        spyOn(fs, 'readFileSync').and.returnValue(JSON.stringify(fake_fetch_json));
-    });
-    afterEach(function () {
-        cfg_parser_revert_mock();
-    });
-    describe('error conditions', function () {
-        it('should explode if there was an issue parsing or reading from fetch.json file', function (done) {
-            fs.readFileSync.and.callFake(function () {
-                throw new Error('massive explosions during file reading!');
-            });
-            save(projectRoot).then(function () {
-                fail('unexpected success handler invoked');
-            }).fail(function (e) {
-                expect(e).toContain('massive explosions');
-            }).done(done);
-        });
-    });
-    describe('happy path', function () {
-        it('should remove all plugins from config.xml and re-add new ones based on those retrieved from fetch.json');
-        it('should only add top-level plugins to config.xml');
-        it('should write individual plugin specs to config.xml');
-        it('should write individual plugin variables to config.xml');
-    });
-    describe('getSpec helper method', function () {
-        it('should return a plugin source\'s url or path property immediately');
-        it('should return a version if a version was provided to plugin id');
-        it('should return a version that includes scope if scope was part of plugin id');
-        it('should fall back to using PluginInfoProvider to retrieve a version as last resort');
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/plugin/search.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin/search.spec.js b/spec-cordova/plugin/search.spec.js
deleted file mode 100644
index aa3ba54..0000000
--- a/spec-cordova/plugin/search.spec.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-// TODO: remove once eslint lands
-/* eslint-env jasmine */
-/* globals fail */
-
-var Q = require('q');
-var rewire = require('rewire');
-var search = rewire('../../src/cordova/plugin/search');
-
-describe('cordova/plugin/search', function () {
-    var hook_mock;
-    var opener_mock;
-    var opener_revert_mock;
-    beforeEach(function () {
-        hook_mock = jasmine.createSpyObj('hooks runner mock', ['fire']);
-        hook_mock.fire.and.returnValue(Q());
-        opener_mock = jasmine.createSpy('opener mock');
-        opener_revert_mock = search.__set__('opener', opener_mock);
-    });
-    afterEach(function () {
-        opener_revert_mock();
-    });
-    it('should fire the before_plugin_search hook', function (done) {
-        var opts = {important: 'options', plugins: []};
-        search(hook_mock, opts).then(function () {
-            expect(hook_mock.fire).toHaveBeenCalledWith('before_plugin_search', opts);
-        }).fail(function (e) {
-            fail('fail handler unexpectedly invoked');
-            console.error(e);
-        }).done(done);
-    });
-    it('should open a link to cordova.apache.org/plugins if no plugins are provided as parameter');
-    it('should open a link to cordova.apache.org/plugins, providing the plugins passed in as a query-string parameter');
-    it('should fire the after_plugin_search hook');
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/plugin/util.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin/util.spec.js b/spec-cordova/plugin/util.spec.js
deleted file mode 100644
index b94412c..0000000
--- a/spec-cordova/plugin/util.spec.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-/* eslint-env jasmine */
-
-var rewire = require('rewire');
-var plugin_util = rewire('../../src/cordova/plugin/util');
-
-describe('cordova/plugin/util', function () {
-    var plugin_info_mock = function () {};
-    var plugin_info_revert_mock;
-    beforeEach(function () {
-        plugin_info_mock.prototype = jasmine.createSpyObj('plugin info provider prototype mock', ['getAllWithinSearchPath']);
-        plugin_info_revert_mock = plugin_util.__set__('PluginInfoProvider', plugin_info_mock);
-    });
-    afterEach(function () {
-        plugin_info_revert_mock();
-    });
-    describe('getInstalledPlugins helper method', function () {
-        it('should return result of PluginInfoProvider\'s getAllWithinSearchPath method', function () {
-            var plugins_list = ['VRPlugin', 'MastodonSocialPlugin'];
-            plugin_info_mock.prototype.getAllWithinSearchPath.and.returnValue(plugins_list);
-            expect(plugin_util.getInstalledPlugins('/some/path/to/a/project')).toEqual(plugins_list);
-        });
-    });
-    describe('saveToConfigXmlOn helper method', function () {
-        it('should return true if config.json\'s autosave option is truthy', function () {
-            expect(plugin_util.saveToConfigXmlOn({
-                auto_save_plugins: true
-            })).toBe(true);
-        });
-        it('should return true if options passed in have a truthy save property', function () {
-            expect(plugin_util.saveToConfigXmlOn({}, {
-                save: true
-            })).toBe(true);
-        });
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/plugin_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/plugin_parser.spec.js b/spec-cordova/plugin_parser.spec.js
deleted file mode 100644
index ad79f08..0000000
--- a/spec-cordova/plugin_parser.spec.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-/* eslint-env jasmine */
-var path = require('path');
-var fs = require('fs');
-var Plugin_parser = require('../src/cordova/plugin_parser');
-var xml = path.join(__dirname, 'fixtures', 'plugins', 'test', 'plugin.xml');
-
-var xml_contents = fs.readFileSync(xml, 'utf-8');
-
-describe('plugin.xml parser', function () {
-    beforeEach(function () {
-        spyOn(fs, 'readFileSync').and.returnValue(xml_contents);
-    });
-
-    it('Test 001 : should read a proper plugin.xml file', function () {
-        var cfg;
-        expect(function () {
-            cfg = new Plugin_parser(xml);
-        }).not.toThrow();
-        expect(cfg).toBeDefined();
-        expect(cfg.doc).toBeDefined();
-    });
-    it('Test 002 : should be able to figure out which platforms the plugin supports', function () {
-        var cfg = new Plugin_parser(xml);
-        expect(cfg.platforms.length).toBe(1);
-        expect(cfg.platforms.indexOf('ios') > -1).toBe(true);
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/prepare.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/prepare.spec.js b/spec-cordova/prepare.spec.js
deleted file mode 100644
index dca1334..0000000
--- a/spec-cordova/prepare.spec.js
+++ /dev/null
@@ -1,276 +0,0 @@
-/**
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-
-/* eslint-env jasmine */
-/* global fail */
-
-var path = require('path');
-var rewire = require('rewire');
-var util = require('../src/cordova/util');
-var cordova_config = require('../src/cordova/config');
-var prepare = rewire('../src/cordova/prepare');
-var restore = require('../src/cordova/restore-util');
-var platforms = require('../src/platforms/platforms');
-var HooksRunner = require('../src/hooks/HooksRunner');
-var Q = require('q');
-var PlatformJson = require('cordova-common').PlatformJson;
-var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
-
-var project_dir = '/some/path';
-
-describe('cordova/prepare', function () {
-    var platform_api_prepare_mock;
-    var platform_api_add_mock;
-    var platform_api_remove_mock;
-    beforeEach(function () {
-        platform_api_prepare_mock = jasmine.createSpy('prepare').and.returnValue(Q());
-        platform_api_add_mock = jasmine.createSpy('add').and.returnValue(Q());
-        platform_api_remove_mock = jasmine.createSpy('remove').and.returnValue(Q());
-        spyOn(platforms, 'getPlatformApi').and.callFake(function (platform, rootDir) {
-            return {
-                prepare: platform_api_prepare_mock,
-                getPlatformInfo: jasmine.createSpy('getPlatformInfo').and.returnValue({
-                    locations: {
-                        www: path.join(project_dir, 'platforms', platform, 'www')
-                    }
-                }),
-                removePlugin: platform_api_add_mock,
-                addPlugin: platform_api_remove_mock
-            };
-        });
-        spyOn(PlatformJson, 'load');
-        spyOn(HooksRunner.prototype, 'fire').and.returnValue(Q());
-        spyOn(util, 'isCordova').and.returnValue(true);
-    });
-
-    describe('main method', function () {
-        beforeEach(function () {
-            spyOn(cordova_config, 'read').and.returnValue({});
-            spyOn(restore, 'installPlatformsFromConfigXML').and.returnValue(Q());
-            spyOn(restore, 'installPluginsFromConfigXML').and.returnValue(Q());
-            spyOn(util, 'cdProjectRoot').and.returnValue(project_dir);
-            spyOn(util, 'preProcessOptions').and.callFake(function (options) {
-                var platforms = options.platforms || [];
-                return {'platforms':platforms};
-            });
-            spyOn(prepare, 'preparePlatforms').and.returnValue(Q);
-        });
-        describe('failure', function () {
-            it('should invoke util.preProcessOptions as preflight task checker, which, if fails, should trigger promise rejection and only fire the before_prepare hook', function (done) {
-                util.preProcessOptions.and.callFake(function () {
-                    throw new Error('preProcessOption error'); 
-                });
-                prepare({}).then(function () {
-                    fail('unexpected failure handler invoked');
-                }).fail(function (e) {
-                    expect(e.message).toBe('preProcessOption error');
-                    expect(HooksRunner.prototype.fire).toHaveBeenCalledWith('before_prepare', jasmine.any(Object));
-                }).done(done);
-            });
-            it('should invoke util.cdProjectRoot as a preflight task checker, which, if fails, should trigger a promise rejection and fire no hooks', function (done) {
-                util.cdProjectRoot.and.callFake(function () {
-                    throw new Error('cdProjectRoot error');
-                });
-                prepare({}).then(function () { 
-                    fail('unexpected failure handler invoked');
-                }).fail(function (e) {
-                    expect(e.message).toBe('cdProjectRoot error');
-                    expect(HooksRunner.prototype.fire).not.toHaveBeenCalledWith();
-                }).done(done);
-            });
-        });
-
-        describe('success', function () {
-            it('should fire the before_prepare hook and provide platform and path information as arguments', function (done) {
-                prepare({}).then(function () {
-                    expect(HooksRunner.prototype.fire).toHaveBeenCalledWith('before_prepare', jasmine.any(Object));
-                }).fail(function (e) {
-                    fail('unexpected failure handler invoked');
-                    console.error(e);
-                }).done(done);
-            });
-            it('should invoke restore module\'s installPlatformsFromConfigXML method', function (done) {
-                prepare({}).then(function () {
-                    expect(restore.installPlatformsFromConfigXML).toHaveBeenCalled();
-                }).fail(function (e) {
-                    fail('unexpected failure handler invoked');
-                    console.error(e);
-                }).done(done);
-            });
-            it('should retrieve PlatformApi instances for each platform provided', function (done) {
-                prepare({'platforms':['android', 'ios']}).then(function () {
-                    expect(platforms.getPlatformApi).toHaveBeenCalledTimes(4);
-                    //expect(platforms.getPlatformApi).toHaveBeenCalledWith(['android', path.join('some','path','platforms','android')], ['ios', path.join('some','path','platforms','ios')], ['android'], ['ios']);
-                    expect(platforms.getPlatformApi).toHaveBeenCalledWith('android', path.join('/','some','path','platforms','android'));
-                    expect(platforms.getPlatformApi).toHaveBeenCalledWith('ios', path.join('/','some','path','platforms','ios'));
-                    expect(platforms.getPlatformApi).toHaveBeenCalledWith('android');
-                    expect(platforms.getPlatformApi).toHaveBeenCalledWith('ios');
-                }).fail(function (e) {
-                    fail('unexpected failure handler invoked');
-                    console.error(e);
-                }).done(done);
-            });
-            it('should invoke restore module\'s installPluginsFromConfigXML method', function (done) {
-                prepare({platforms:[]}).then(function () {
-                    expect(restore.installPluginsFromConfigXML).toHaveBeenCalled();
-                }).fail(function (e) {
-                    fail('unexpected failure handler invoked');
-                    console.error(e);
-                }).done(done);
-            });
-            it('should invoke preparePlatforms method, providing the appropriate platforms', function (done) {
-                prepare({platforms:['android']}).then(function () {
-                    expect(prepare.preparePlatforms).toHaveBeenCalledWith(['android'],'/some/path', jasmine.any(Object));
-                }).fail(function (e) {
-                    fail('unexpected failure handler invoked');
-                    console.error(e);
-                }).done(done);
-
-            });
-            it('should fire the after_prepare hook and provide platform and path information as arguments', function (done) {
-                prepare({platforms:['android']}).then(function () {
-                    expect(HooksRunner.prototype.fire).toHaveBeenCalledWith('after_prepare', jasmine.any(Object));
-                }).fail(function (e) {
-                    fail('unexpected failure handler invoked');
-                    console.error(e);
-                }).done(done);
-            });
-        });
-    });
-
-    describe('preparePlatforms helper method', function () {
-        var cfg_parser_mock = function () {};
-        var cfg_parser_revert_mock;
-        var platform_munger_mock = function () {};
-        var platform_munger_revert_mock;
-        var platform_munger_save_mock;
-        beforeEach(function () {
-            spyOn(prepare, 'restoreMissingPluginsForPlatform').and.returnValue(Q());
-            cfg_parser_revert_mock = prepare.__set__('ConfigParser', cfg_parser_mock);
-            platform_munger_save_mock = jasmine.createSpy('platform munger save mock');
-            platform_munger_mock.prototype = jasmine.createSpyObj('platform munger prototype mock', ['add_config_changes']);
-            platform_munger_mock.prototype.add_config_changes.and.returnValue({
-                save_all: platform_munger_save_mock
-            });
-            platform_munger_revert_mock = prepare.__set__('PlatformMunger', platform_munger_mock);
-            spyOn(util, 'projectConfig').and.returnValue(project_dir);
-            spyOn(util, 'projectWww').and.returnValue(path.join(project_dir, 'www'));
-            
-        });
-        afterEach(function () {
-            cfg_parser_revert_mock();
-            platform_munger_revert_mock();
-        });
-        it('should call restoreMissingPluginsForPlatform', function (done) {
-            prepare.preparePlatforms(['android'],project_dir, {}).then(function () {
-                expect(prepare.restoreMissingPluginsForPlatform).toHaveBeenCalled();
-            }).fail(function (e) {
-                fail('unexpected failure handler invoked');
-                console.error(e);
-            }).done(done);        
-        });
-        it('should retrieve the platform API via getPlatformApi per platform provided, and invoke the prepare method from that API', function (done) {
-            prepare.preparePlatforms(['android'],project_dir, {}).then(function () {
-                expect(platforms.getPlatformApi).toHaveBeenCalledWith('android');
-                expect(platform_api_prepare_mock).toHaveBeenCalled();
-            }).fail(function (e) {
-                fail('unexpected failure handler invoked');
-                console.error(e);
-            }).done(done); 
-        });
-        it('should fire a pre_package hook for the windows', function (done) {
-            prepare.preparePlatforms(['windows'],project_dir, {}).then(function () {
-                expect(HooksRunner.prototype.fire).toHaveBeenCalledWith('pre_package', jasmine.any(Object));
-            }).fail(function (e) {
-                fail('unexpected failure handler invoked');
-                console.error(e);
-            }).done(done); 
-        });
-        // TODO: xit'ed the one below as dynamic requires make it difficult to spy on
-        // Can we refactor the relevant code to make it testable?
-        xit('should invoke browserify if the browserify option is provided');
-        it('should handle config changes by invoking add_config_changes and save_all', function (done) {
-            prepare.preparePlatforms(['android'],project_dir, {}).then(function () {
-                expect(platform_munger_mock.prototype.add_config_changes).toHaveBeenCalled();
-                expect(platform_munger_save_mock).toHaveBeenCalled();
-            }).fail(function (e) {
-                fail('unexpected failure handler invoked');
-                console.error(e);
-            }).done(done); 
-        });
-    });
-
-    describe('restoreMissingPluginsForPlatform helper method', function () {
-        var is_plugin_installed_mock;
-        var is_plugin_provider_get_mock;
-        it('should resolve quickly and not invoke getPlatformAPI in the easy case of there being no difference between old and new platform.json', function (done) {
-            is_plugin_installed_mock = jasmine.createSpy('is plugin installed mock');
-            // mock platform json value below
-            PlatformJson.load.and.callFake(function (platformJsonPath, plat) {
-                return {
-                    isPluginInstalled: is_plugin_installed_mock,
-                    root: {
-                        installed_plugins: [],
-                        dependent_plugins: []
-                    }
-                };
-            });
-
-            prepare.restoreMissingPluginsForPlatform('android', project_dir, {}).then(function () {
-                expect(platforms.getPlatformApi).not.toHaveBeenCalled();
-            }).fail(function (e) {
-                fail('unexpected failure handler invoked');
-                console.error(e);
-            }).done(done); 
-        });
-        it('should leverage platform API to remove and add any missing plugins identified', function (done) {
-            is_plugin_installed_mock = jasmine.createSpy('is plugin installed mock');
-            is_plugin_provider_get_mock = jasmine.createSpy('is plugin provider get mock');
-            // mock platform json value below
-            PlatformJson.load.and.callFake(function (platformJsonPath, plat) {
-                //set different installed plugins to simulate missing plugins
-                var missingPlugins;
-                if (platformJsonPath === '/some/path/platforms/android') {
-                    missingPlugins = {'cordova-plugin-device': {}};
-                } else {
-                    missingPlugins = {'cordova-plugin-camera': {}};
-                }
-                return {
-                    isPluginInstalled: is_plugin_installed_mock,
-                    root: {
-                        installed_plugins: missingPlugins,
-                        dependent_plugins: []
-                    }
-                };
-            });
-            spyOn(PluginInfoProvider.prototype, 'get').and.callFake(function () {
-                return is_plugin_provider_get_mock;
-            });
-            prepare.restoreMissingPluginsForPlatform('android', project_dir, {}).then(function () {
-                expect(platforms.getPlatformApi).toHaveBeenCalled();
-                expect(platform_api_add_mock).toHaveBeenCalled();
-                expect(platform_api_remove_mock).toHaveBeenCalled();
-                expect(PluginInfoProvider.prototype.get).toHaveBeenCalled();
-            }).fail(function (e) {
-                fail('unexpected failure handler invoked');
-                console.error(e);
-            }).done(done); 
-        });
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d164a88f/spec-cordova/project-metadata-apis.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/project-metadata-apis.spec.js b/spec-cordova/project-metadata-apis.spec.js
deleted file mode 100644
index acffaf9..0000000
--- a/spec-cordova/project-metadata-apis.spec.js
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-var cordova = require('../src/cordova/cordova'),
-    path = require('path');
-
-describe('retrieval of project metadata', function () {
-    var projectRoot = path.resolve(__dirname, 'Projects/ProjectMetadata');
-
-    it('Test 001 : retrieve platforms saved in config.xml', function (done) {
-        var androidVersion = '3.7.1';
-        var browserSrc = 'https://github.com/apache/cordova-browser.git';
-
-        cordova.projectMetadata.getPlatforms(projectRoot)
-            .then(function (platforms) {
-                expect(platforms.length).toBe(2);
-
-                // Android platform has version defined in deprecated version field - should still work.
-                var androidPlatform = findPlatform(platforms, 'android');
-                expect(androidPlatform).not.toBeNull();
-                expect(androidPlatform.version).toBe(androidVersion);
-                expect(androidPlatform.src).toBeUndefined();
-
-                // Browser platform has source defined in the spec field.
-                var browserPlatform = findPlatform(platforms, 'browser');
-                expect(browserPlatform).not.toBeNull();
-                expect(browserPlatform.version).toBeUndefined();
-                expect(browserPlatform.src).toBe(browserSrc);
-            }).finally(done);
-    });
-
-    it('Test 002 : retrieve plugins saved in config.xml', function (done) {
-        var deviceId = 'org.apache.cordova.device';
-        var deviceVersion = '0.3.0';
-
-        var cameraId = 'org.apache.cordova.camera';
-        var cameraSrc = 'https://github.com/apache/cordova-plugin-camera.git';
-        var cameraVariableName = 'TEST_VARIABLE';
-        var cameraVariableValue = 'My Test Variable';
-
-        var fileId = 'org.apache.cordova.file';
-        var fileSource = 'https://github.com/apache/cordova-plugin-file.git';
-
-        cordova.projectMetadata.getPlugins(projectRoot)
-            .then(function (plugins) {
-                expect(plugins.length).toBe(3);
-
-                // Device plugin uses current spec attribute to specify version - should be returned in version field.
-                var devicePlugin = findPlugin(plugins, deviceId);
-                expect(devicePlugin).not.toBeNull();
-                expect(devicePlugin.version).toBe(deviceVersion);
-                expect(devicePlugin.src).toBeUndefined();
-
-                var deviceVariables = devicePlugin.variables;
-                expect(deviceVariables).not.toBeNull();
-                expect(Array.isArray(deviceVariables)).toBeTruthy();
-                expect(deviceVariables.length).toBe(0);
-
-                // Camera plugin uses deprecated src attribute - still should work.
-                var cameraPlugin = findPlugin(plugins, cameraId);
-                expect(cameraPlugin).not.toBeNull();
-                expect(cameraPlugin.src).toBe(cameraSrc);
-                expect(cameraPlugin.version).toBeUndefined();
-
-                var cameraVariables = cameraPlugin.variables;
-                expect(cameraVariables).not.toBeNull();
-                expect(cameraVariables.length).toBe(1);
-                expect(cameraVariables[0].name).toBe(cameraVariableName);
-                expect(cameraVariables[0].value).toBe(cameraVariableValue);
-
-                // File plugin uses deprecated src and version attributes - version should be ignored.
-                var filePlugin = findPlugin(plugins, fileId);
-                expect(filePlugin).not.toBeNull();
-                expect(filePlugin.version).toBeUndefined();
-                expect(filePlugin.src).toBe(fileSource);
-
-                var fileVariables = filePlugin.variables;
-                expect(fileVariables).not.toBeNull();
-                expect(Array.isArray(fileVariables)).toBeTruthy();
-                expect(fileVariables.length).toBe(0);
-            }).finally(done);
-    });
-});
-
-function findPlatform(platforms, platformName) {
-    for (var i = 0; i < platforms.length; i++) {
-        if (platforms[i].name === platformName) {
-            return platforms[i];
-        }
-    }
-    return null;
-}
-
-function findPlugin(plugins, pluginId) {
-    for (var i = 0; i < plugins.length; i++) {
-        if (plugins[i].name === pluginId) {
-            return plugins[i];
-        }
-    }
-    return null;
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message