cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject git commit: [Tizen] Remove tests for source-file, header-file, etc. install/uninstall, which are now noop
Date Tue, 07 Oct 2014 18:51:52 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master 6aa0480cc -> f528ffd2d


[Tizen] Remove tests for source-file, header-file, etc. install/uninstall, which are now noop

github: close #17


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

Branch: refs/heads/master
Commit: f528ffd2ddd86cd4ea2d8c967c3ba603507440a9
Parents: 6aa0480
Author: Gabriel Schulhof <gabriel.schulhof@intel.com>
Authored: Thu May 22 12:12:09 2014 +0300
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Oct 7 14:49:32 2014 -0400

----------------------------------------------------------------------
 cordova-lib/package.json                        |  1 -
 .../spec-plugman/platforms/tizen.spec.js        | 42 +++++++++----------
 .../spec-plugman/plugins/DummyPlugin/plugin.xml |  8 ++--
 cordova-lib/src/plugman/platforms/tizen.js      | 43 +++++---------------
 4 files changed, 34 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f528ffd2/cordova-lib/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/package.json b/cordova-lib/package.json
index fe05fb9..73f155a 100644
--- a/cordova-lib/package.json
+++ b/cordova-lib/package.json
@@ -40,7 +40,6 @@
     "unorm": ">=1.3"
   },
   "devDependencies": {
-    "temp": "0.6.x",
     "jshint": "2.5.x",
     "jasmine-node": "~1"
   },

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f528ffd2/cordova-lib/spec-plugman/platforms/tizen.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/platforms/tizen.spec.js b/cordova-lib/spec-plugman/platforms/tizen.spec.js
index 79198bc..7acf4af 100644
--- a/cordova-lib/spec-plugman/platforms/tizen.spec.js
+++ b/cordova-lib/spec-plugman/platforms/tizen.spec.js
@@ -16,21 +16,25 @@
  *
 */
 var tizen = require('../../src/plugman/platforms/tizen'),
-	common = require('../../src/plugman/platforms/common'),
-	temp = require('temp'),
-	os = require('osenv'),
-	fs = require('fs'),
-	et = require('elementtree'),
-	path = require('path'),
-	tizen_project = path.join(__dirname, '..', 'projects', 'tizen'),
-	destination = temp.path(),
-	shell = require('shelljs'),
-	dummyPluginPath = path.join(__dirname, '..', 'plugins', 'DummyPlugin'),
-	dummyPlugin = et.XML(fs.readFileSync(
-		path.join(dummyPluginPath, 'plugin.xml'), {encoding: "utf-8"})),
-	dummySources = dummyPlugin
-		.find('./platform[@name="tizen"]')
-		.findall('./source-file');
+    common = require('../../src/plugman/platforms/common'),
+    os = require('osenv'),
+    fs = require('fs'),
+    et = require('elementtree'),
+    path = require('path'),
+    shell = require('shelljs'),
+    temp = path.join( os.tmpdir(), 'plugman-' + ((function() {
+        var index, subIndex,
+           set = 'abcdefghijklmnopqrstuvwxyz0123456789',
+           str = '';
+
+        for ( index = 0 ; index < 12 ; index++ ) {
+            subIndex = Math.round( Math.random() * ( set.length - 1 ) );
+            str += set.substring( subIndex, subIndex + 1 );
+        }
+
+        return str;
+    })() )),
+   tizen_project = path.join(__dirname, '..', 'projects', 'tizen');
 
 describe('Tizen project handler', function() {
 	describe('www_dir method', function() {
@@ -39,15 +43,9 @@ describe('Tizen project handler', function() {
 		});
 	});
 	describe('Manipulating project files', function() {
-		beforeEach(function() {
-			shell.cp('-rf', path.join(tizen_project, '*'), destination);
-		});
-		afterEach(function() {
-			shell.rm('-rf', destination);
-		});
 		describe('package_name method', function() {
 			it('should return the id of the config.xml root element', function() {
-				expect(tizen.package_name(destination)).toEqual("TizenTestPackage");
+				expect(tizen.package_name(tizen_project)).toEqual("TizenTestPackage");
 			});
 		});
 	});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f528ffd2/cordova-lib/spec-plugman/plugins/DummyPlugin/plugin.xml
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/plugins/DummyPlugin/plugin.xml b/cordova-lib/spec-plugman/plugins/DummyPlugin/plugin.xml
index 0e88443..2a24b3b 100644
--- a/cordova-lib/spec-plugman/plugins/DummyPlugin/plugin.xml
+++ b/cordova-lib/spec-plugman/plugins/DummyPlugin/plugin.xml
@@ -167,10 +167,10 @@
         </js-module>
     </platform>
 
-		<!-- tizen -->
-		<platform name="tizen">
-			<source-file src="src/tizen/dummer.js"/>
-		</platform>
+    <!-- tizen -->
+    <platform name="tizen">
+        <source-file src="src/tizen/dummer.js"/>
+    </platform>
 
     <!-- windows8 -->
     <platform name="windows8">

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f528ffd2/cordova-lib/src/plugman/platforms/tizen.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/tizen.js b/cordova-lib/src/plugman/platforms/tizen.js
index b346ecd..ed12c0b 100644
--- a/cordova-lib/src/plugman/platforms/tizen.js
+++ b/cordova-lib/src/plugman/platforms/tizen.js
@@ -24,7 +24,6 @@
 
 var path = require('path')
     , fs = require('fs')
-    , common = require('./common')
     , events = require('../../events')
     , xml_helpers = require(path.join(__dirname, '..', '..', 'util', 'xml-helpers'));
 
@@ -53,45 +52,23 @@ module.exports = {
         return widget_doc._root.attrib['id'];
     },
     'source-file':{
-        install:function(source_el, plugin_dir, project_dir, plugin_id) {
-            var dest = path.join(source_el.attrib['target-dir'], path.basename(source_el.attrib['src']));
-            common.copyFile(plugin_dir, source_el.attrib['src'], project_dir, dest);
-        },
-        uninstall:function(source_el, project_dir, plugin_id) {
-            var dest = path.join(source_el.attrib['target-dir'], path.basename(source_el.attrib['src']));
-            common.removeFile(project_dir, dest);
-        }
+        install: function(source_el, plugin_dir, project_dir, plugin_id) {},
+        uninstall: function(source_el, project_dir, plugin_id) {}
     },
     'header-file': {
-        install:function(source_el, plugin_dir, project_dir, plugin_id) {
-            events.emit('verbose', 'header-fileinstall is not supported for firefoxos');
-        },
-        uninstall:function(source_el, project_dir, plugin_id) {
-            events.emit('verbose', 'header-file.uninstall is not supported for firefoxos');
-        }
+        install: function(source_el, plugin_dir, project_dir, plugin_id) {},
+        uninstall: function(source_el, project_dir, plugin_id) {}
     },
     'resource-file':{
-        install:function(el, plugin_dir, project_dir, plugin_id) {
-            events.emit('verbose', 'resource-file.install is not supported for firefoxos');
-        },
-        uninstall:function(el, project_dir, plugin_id) {
-            events.emit('verbose', 'resource-file.uninstall is not supported for firefoxos');
-        }
+        install: function(source_el, plugin_dir, project_dir, plugin_id) {},
+        uninstall: function(source_el, project_dir, plugin_id) {}
     },
     'framework': {
-        install:function(source_el, plugin_dir, project_dir, plugin_id) {
-            events.emit('verbose', 'framework.install is not supported for firefoxos');
-        },
-        uninstall:function(source_el, project_dir, plugin_id) {
-            events.emit('verbose', 'framework.uninstall is not supported for firefoxos');
-        }
+        install: function(source_el, plugin_dir, project_dir, plugin_id) {},
+        uninstall: function(source_el, project_dir, plugin_id) {}
     },
     'lib-file': {
-        install:function(source_el, plugin_dir, project_dir, plugin_id) {
-            events.emit('verbose', 'lib-file.install is not supported for firefoxos');
-        },
-        uninstall:function(source_el, project_dir, plugin_id) {
-            events.emit('verbose', 'lib-file.uninstall is not supported for firefoxos');
-        }
+        install: function(source_el, plugin_dir, project_dir, plugin_id) {},
+        uninstall: function(source_el, project_dir, plugin_id) {}
     }
 };


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


Mime
View raw message