cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [32/50] [abbrv] git commit: added spec stubs for install/uninstall to do with transactions of (uninstall) modifications
Date Tue, 23 Apr 2013 23:01:00 GMT
added spec stubs for install/uninstall to do with transactions of (uninstall) modifications


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

Branch: refs/heads/master
Commit: e036b56dbe893dac15a20c07ac8715ffc49d4465
Parents: c000040
Author: Fil Maj <maj.fil@gmail.com>
Authored: Mon Apr 22 13:35:30 2013 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Mon Apr 22 13:35:30 2013 -0700

----------------------------------------------------------------------
 spec/install.spec.js           |   56 +++-------------------------------
 spec/platforms/android.spec.js |    6 ++++
 spec/uninstall.spec.js         |   33 ++------------------
 src/platforms/common.js        |    9 +++++-
 4 files changed, 22 insertions(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e036b56d/spec/install.spec.js
----------------------------------------------------------------------
diff --git a/spec/install.spec.js b/spec/install.spec.js
index 962ae96..88c2ca4 100644
--- a/spec/install.spec.js
+++ b/spec/install.spec.js
@@ -33,30 +33,16 @@ describe('install', function() {
             shell.cp('-rf', dummyplugin, plugins_dir);
         });
 
+        it('should call fetch if provided plugin cannot be resolved locally');
+        it('should generate an array of transactions required to run an installation');
+        it('should pass transaction log to appropriate platform handler\'s install');
+
         it('should call prepare after a successful install', function() {
             shell.cp('-rf', android_one_project, temp);
             var s = spyOn(plugman, 'prepare');
             install('android', temp, 'DummyPlugin', plugins_dir, {});
             expect(s).toHaveBeenCalled();
         });
-        it('on an Android project should call into Android module\'s handleInstall', function()
{
-            shell.cp('-rf', android_one_project, temp);
-            var s = spyOn(android, 'handleInstall');
-            install('android', temp, 'DummyPlugin', plugins_dir, {});
-            expect(s).toHaveBeenCalled();
-        });
-        it('on a BlackBerry project should call into BlackBerry module\'s handleInstall',
function() {
-            shell.cp('-rf', blackberry_project, temp);
-            var s = spyOn(blackberry, 'handleInstall');
-            install('blackberry', temp, 'DummyPlugin', plugins_dir, {});
-            expect(s).toHaveBeenCalled();
-        });
-        it('on an iOS project should call into iOS module\'s handleInstall', function() {
-            shell.cp('-rf', ios_project, temp);
-            var s = spyOn(ios, 'handleInstall');
-            install('ios', temp, 'DummyPlugin', plugins_dir, {});
-            expect(s).toHaveBeenCalled();
-        });
     });
 
     describe('failure', function() {
@@ -71,38 +57,6 @@ describe('install', function() {
                 install('android', temp, 'VariablePlugin', plugins_dir, {});
             }).toThrow('Variable(s) missing: API_KEY');
         });
-        it('should throw if installation failed', function() {
-            shell.cp('-rf', android_one_project, temp);
-            shell.cp('-rf', faultyplugin, plugins_dir);
-            var didThrow = false;
-            try {
-                install('android', temp, 'FaultyPlugin', plugins_dir, {});
-            } catch(e) {
-                didThrow = true;
-                expect(e.message).toMatch(/does not exist/);
-            }
-            expect(didThrow).toBe(true);
-        });
-        it('should call forceUninstall if installation fails to revert changes', function()
{
-            shell.cp('-rf', android_one_project, temp);
-            shell.cp('-rf', faultyplugin, plugins_dir);
-            var s = spyOn(android, 'forceUninstall');
-            expect(function() {
-                install('android', temp, 'FaultyPlugin', plugins_dir, {});
-            }).toThrow();
-            expect(s).toHaveBeenCalled();
-        });
-        it('should throw an extra-long error if both installation and reversion failed',
function() {
-            shell.cp('-rf', android_one_project, temp);
-            shell.cp('-rf', faultyplugin, plugins_dir);
-            var didThrow = false;
-            try {
-                install('android', temp, 'FaultyPlugin', plugins_dir, {});
-            } catch(e) {
-                didThrow = true;
-                expect(e.message).toMatch(/reverting changes also caused issues!/);
-            }
-            expect(didThrow).toBe(true);
-        });
+        it('should handle a failed install by passing completed transactions into appropriate
handler\'s uninstall method'); 
     });
 });

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e036b56d/spec/platforms/android.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/android.spec.js b/spec/platforms/android.spec.js
index e69de29..27c6986 100644
--- a/spec/platforms/android.spec.js
+++ b/spec/platforms/android.spec.js
@@ -0,0 +1,6 @@
+
+
+describe('android project handler', function() {
+    it('should have an install function');
+    it('should have an uninstall function');
+});

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e036b56d/spec/platforms/common.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/common.spec.js b/spec/platforms/common.spec.js
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e036b56d/spec/uninstall.spec.js
----------------------------------------------------------------------
diff --git a/spec/uninstall.spec.js b/spec/uninstall.spec.js
index bf2f9d3..c0fd48a 100644
--- a/spec/uninstall.spec.js
+++ b/spec/uninstall.spec.js
@@ -30,36 +30,8 @@ describe('uninstall', function() {
     });
 
     describe('success', function() {
-        it('on an Android project should call into Android module\'s handleUninstall', function()
{
-            // Set up android project w/ one plugin
-            shell.cp('-rf', android_one_project, temp);
-            shell.cp('-rf', dummyplugin, plugins_dir);
-            install('android', temp, 'DummyPlugin', plugins_dir, {});
-
-            var s = spyOn(android, 'handleUninstall');
-            uninstall('android', temp, 'DummyPlugin', plugins_dir, {});
-            expect(s).toHaveBeenCalled();
-        });
-        it('on a BlackBerry project should call into BlackBerry module\'s handleUninstall',
function() {
-            // Set up blackberry project w/ one plugin
-            shell.cp('-rf', blackberry_project, temp);
-            shell.cp('-rf', dummyplugin, plugins_dir);
-            install('blackberry', temp, 'DummyPlugin', plugins_dir, {});
-
-            var s = spyOn(blackberry, 'handleUninstall');
-            uninstall('blackberry', temp, 'DummyPlugin', plugins_dir, {});
-            expect(s).toHaveBeenCalled();
-        });
-        it('on an iOS project should call into iOS module\'s handleUninstall', function()
{
-            // Set up ios project w/ one plugin
-            shell.cp('-rf', ios_project, temp);
-            shell.cp('-rf', dummyplugin, plugins_dir);
-            install('ios', temp, 'DummyPlugin', plugins_dir, {});
-
-            var s = spyOn(ios, 'handleUninstall');
-            uninstall('ios', temp, 'DummyPlugin', plugins_dir, {});
-            expect(s).toHaveBeenCalled();
-        });
+        it('should generate an array of transactions required to run an uninstallation');
+        it('should pass transaction log to appropriate platform handler\'s uninstall');
     });
 
     describe('failure', function() {
@@ -81,5 +53,6 @@ describe('uninstall', function() {
                 uninstall('android', temp, 'SomePlugin', plugins_dir, {});
             }).toThrow('Plugin "SomePlugin" not found. Already uninstalled?');
         });
+        it('should handle a failed uninstall by passing completed transactions into appropriate
handler\'s uninstall method'); 
     });
 });

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e036b56d/src/platforms/common.js
----------------------------------------------------------------------
diff --git a/src/platforms/common.js b/src/platforms/common.js
index 24f3ea5..cd95d84 100644
--- a/src/platforms/common.js
+++ b/src/platforms/common.js
@@ -1,5 +1,12 @@
 
 
 module.exports = {
-
+    // helper for resolving source paths from plugin.xml
+    // throws File Not Found
+    resolveSrcPath:function() {
+    },
+    // helper for resolving target paths from plugin.xml into a cordova project
+    // throws File Exists
+    resolveTargetPath:function() {
+    }
 };


Mime
View raw message