updating force-install for ios-config-xml

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

Branch: refs/heads/future
Commit: 9f83ba25f413992c108dfe2a4383b55aec35f2ba
Parents: c2c528e
Author: Anis Kadri <[email protected]>
Authored: Tue Apr 2 20:03:47 2013 -0700
Committer: Anis Kadri <[email protected]>
Committed: Tue Apr 2 20:03:47 2013 -0700

----------------------------------------------------------------------
 test/ios-config-xml-install.js |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9f83ba25/test/ios-config-xml-install.js
----------------------------------------------------------------------
diff --git a/test/ios-config-xml-install.js b/test/ios-config-xml-install.js
index fde9de3..78d02a6 100644
--- a/test/ios-config-xml-install.js
+++ b/test/ios-config-xml-install.js
@@ -33,6 +33,7 @@ var fs = require('fs')
 
   //, assetsDir = path.resolve(config.projectPath, 'www')
   , srcDir = path.resolve(test_project_dir, 'SampleApp/Plugins')
+  , wwwDir = path.resolve(test_project_dir, 'www')
   , resDir = path.resolve(test_project_dir, 'SampleApp/Resources');
 
 exports.setUp = function(callback) {
@@ -74,6 +75,7 @@ exports['should move the js file'] = function (test) {
     ios.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et, 
{ APP_ID: 12345 });
     var jsPath = path.join(test_dir, 'projects', 'ios-config-xml', 'www', 
'childbrowser.js');
     test.ok(fs.existsSync(jsPath));
+    test.ok(fs.statSync(jsPath).isFile());
     test.done();
 }
 
@@ -239,23 +241,12 @@ exports['should not install a plugin that is already 
installed'] = function (tes
 
 exports['should skip collision check when installation is forced'] = function 
(test) {
     ios.handlePlugin('install', test_project_dir, test_plugin_dir, plugin_et, 
{ APP_ID: 12345 });
+    // deleting files because only presence in config.xml determines 
installation
+    shell.rm('-rf', srcDir + '/*');
+    shell.rm('-rf', resDir + '/*');
+    shell.rm('-rf', wwwDir + '/*');
     test.doesNotThrow(function(){ios.handlePlugin('force-install', 
test_project_dir, test_plugin_dir, plugin_et); }, 
                 /already installed/
                );
     test.done();
 }
-
-//exports['should revert changes when an error occurs'] = function (test) {
-//    var faulty_plugin_dir = path.join(test_dir, 'plugins', 'FaultyPlugin')
-//    var faulty_xml_path = path.join(test_dir, 'plugins', 'FaultyPlugin', 
'plugin.xml')
-//    var faulty_plugin_et  = new 
et.ElementTree(et.XML(fs.readFileSync(faulty_xml_path, 'utf-8')));
-//    
-//    var project_dir = path.join(test_dir, 'projects', 'ios-new-config-xml')
-//    
-//    ios.handlePlugin('install', project_dir, faulty_plugin_dir, 
faulty_plugin_et, { APP_ID: 12345 });
-//
-//    test.throws(function(){ios.handlePlugin('install', project_dir, 
test_plugin_dir, plugin_et); }, 
-//                /already installed/
-//               );
-//    test.done();
-//}

Reply via email to