Updated Branches: refs/heads/future abc795fa0 -> 4d411d8bf
android handler spec stubs. Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/4d411d8b Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/4d411d8b Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/4d411d8b Branch: refs/heads/future Commit: 4d411d8bff77673ea7f8d34158da6bce7749d77e Parents: abc795f Author: Fil Maj <[email protected]> Authored: Mon Apr 22 17:17:50 2013 -0700 Committer: Fil Maj <[email protected]> Committed: Mon Apr 22 17:17:50 2013 -0700 ---------------------------------------------------------------------- spec/platforms/android.spec.js | 46 ++++++++++++++++++++++++++++++++-- src/platforms/android.js | 2 +- 2 files changed, 44 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4d411d8b/spec/platforms/android.spec.js ---------------------------------------------------------------------- diff --git a/spec/platforms/android.spec.js b/spec/platforms/android.spec.js index 27c6986..c6e5a68 100644 --- a/spec/platforms/android.spec.js +++ b/spec/platforms/android.spec.js @@ -1,6 +1,46 @@ - +var android = require('../../src/platforms/android'); describe('android project handler', function() { - it('should have an install function'); - it('should have an uninstall function'); + it('should have an install function', function() { + expect(typeof android.install).toEqual('function'); + }); + it('should have an uninstall function', function() { + expect(typeof android.uninstall).toEqual('function'); + }); + it('should return cordova-android project www location using www_dir', function() { + expect(android.www_dir('/')).toEqual('/assets/www'); + }); + + describe('installation', function() { + describe('of <source-file> elements', function() { + it('should copy stuff from one location to another by calling common.straightCopy'); + it('should throw if source file cannot be found'); + it('should throw if target file already exists'); + }); + describe('of <library-file> elements', function() { + it('should copy stuff from one location to another by calling common.straightCopy'); + it('should throw if source file cannot be found'); + it('should throw if target file already exists'); + }); + describe('of <config-file> elements', function() { + it('should only target config.xml if that is applicable'); + it('should only target plugins.xml if that is applicable'); + it('should call into xml helper\'s graftXML'); + }); + }); + + describe('uninstallation', function() { + describe('of <source-file> elements', function() { + it('should remove stuff by calling common.deleteJava'); + it('should remove empty dirs from java src dir heirarchy'); + }); + describe('of <library-file> elements', function() { + it('should remove stuff using fs.unlinkSync'); + }); + describe('of <config-file> elements', function() { + it('should only target config.xml if that is applicable'); + it('should only target plugins.xml if that is applicable'); + it('should call into xml helper\'s pruneXML'); + }); + }); }); http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4d411d8b/src/platforms/android.js ---------------------------------------------------------------------- diff --git a/src/platforms/android.js b/src/platforms/android.js index 6fb912a..7bdc436 100644 --- a/src/platforms/android.js +++ b/src/platforms/android.js @@ -81,7 +81,7 @@ function handlePlugin(action, plugin_id, txs, project_dir, plugin_dir, variables var selector = mod.attrib["parent"]; var children = mod.findall('*'); - if( action == 'install') { + if (action == 'install') { if (!xml_helpers.graftXML(xmlDoc, children, selector)) { throw new Error('failed to add config-file children to "' + filename + '"'); }
