Updated Branches:
  refs/heads/future 4d411d8bf -> 1884aac2a

fixed issue in common.js. added test stubs for common platform handler, and a 
few more to android handler


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/1884aac2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/1884aac2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/1884aac2

Branch: refs/heads/future
Commit: 1884aac2a57e5fbcb10f8384285926e312ba24b6
Parents: 4d411d8
Author: Fil Maj <[email protected]>
Authored: Mon Apr 22 17:30:04 2013 -0700
Committer: Fil Maj <[email protected]>
Committed: Mon Apr 22 17:30:04 2013 -0700

----------------------------------------------------------------------
 spec/platforms/android.spec.js |    5 +++++
 spec/platforms/common.spec.js  |   26 ++++++++++++++++++++++++++
 src/platforms/common.js        |    2 +-
 3 files changed, 32 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/1884aac2/spec/platforms/android.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/android.spec.js b/spec/platforms/android.spec.js
index c6e5a68..a7c710e 100644
--- a/spec/platforms/android.spec.js
+++ b/spec/platforms/android.spec.js
@@ -27,6 +27,7 @@ describe('android project handler', function() {
             it('should only target plugins.xml if that is applicable');
             it('should call into xml helper\'s graftXML');
         });
+        it('should interpolate variables properly');
     });
 
     describe('uninstallation', function() {
@@ -42,5 +43,9 @@ describe('android project handler', function() {
             it('should only target plugins.xml if that is applicable');
             it('should call into xml helper\'s pruneXML');
         });
+        describe('of <asset> elements', function() {
+            it('should remove www\'s plugins <plugin-id> directory');
+            it('should remove stuff specified by the element');
+        });
     });
 });

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/1884aac2/spec/platforms/common.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/common.spec.js b/spec/platforms/common.spec.js
index e69de29..9c568a5 100644
--- a/spec/platforms/common.spec.js
+++ b/spec/platforms/common.spec.js
@@ -0,0 +1,26 @@
+var common = require('../../src/platforms/common');
+
+describe('common platform handler', function() {
+    describe('resolveSrcPath', function() {
+        it('should throw if path cannot be resolved');
+        it('should not throw if path exists');
+    });
+
+    describe('resolveTargetPath', function() {
+        it('should throw if path exists');
+        it('should not throw if path cannot be resolved');
+    });
+
+    describe('straightCopy', function() {
+        it('should throw if source path cannot be resolved');
+        it('should throw if target path exists');
+        it('should call mkdir -p on target path');
+        it('should call cp -f with source/dest paths');
+    });
+
+    describe('deleteJava', function() {
+        it('should call fs.unlinkSync on the provided paths');
+        it('should delete empty directories after removing source code in a 
java src path heirarchy');
+        it('should never delete the top-level src directory, even if all 
plugins added were removed');
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/1884aac2/src/platforms/common.js
----------------------------------------------------------------------
diff --git a/src/platforms/common.js b/src/platforms/common.js
index 523b38a..597a79b 100644
--- a/src/platforms/common.js
+++ b/src/platforms/common.js
@@ -26,7 +26,7 @@ module.exports = {
     },
     // Sometimes we want to remove some java, and prune any unnecessary empty 
directories
     deleteJava:function(project_dir, destFile) {
-        fs.unlinkSync(destFile);
+        fs.unlinkSync(path.resolve(project_dir,destFile));
         // check if directory is empty
         var curDir = path.resolve(project_dir, path.basename(destFile));
         while(curDir !== path.resolve(project_dir, 'src')) {

Reply via email to