cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [3/5] git commit: Adding spec for Tizen platform
Date Tue, 18 Feb 2014 19:56:31 GMT
Adding spec for Tizen platform


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

Branch: refs/heads/master
Commit: 72c3d463ed67e3e81964a19cbc16d425b745d302
Parents: c905e7a
Author: Gabriel Schulhof <gabriel.schulhof@intel.com>
Authored: Mon Feb 3 16:53:52 2014 +0200
Committer: Gabriel Schulhof <gabriel.schulhof@intel.com>
Committed: Tue Feb 4 22:57:40 2014 +0200

----------------------------------------------------------------------
 package.json                                 |  1 +
 spec/platforms/tizen.spec.js                 | 54 +++++++++++++++++++++++
 spec/plugins/DummyPlugin/plugin.xml          |  5 +++
 spec/plugins/DummyPlugin/src/tizen/dummer.js |  0
 spec/projects/tizen/www/config.xml           |  2 +
 5 files changed, 62 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/72c3d463/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 3c07a09..be25561 100644
--- a/package.json
+++ b/package.json
@@ -33,6 +33,7 @@
     "tar.gz": "0.1.1"
   },
   "devDependencies": {
+    "temp": "0.6.x",
     "jasmine-node": "1.7.0",
     "osenv": "0.0.x"
   },

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/72c3d463/spec/platforms/tizen.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/tizen.spec.js b/spec/platforms/tizen.spec.js
new file mode 100644
index 0000000..372e4d3
--- /dev/null
+++ b/spec/platforms/tizen.spec.js
@@ -0,0 +1,54 @@
+/*
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+var tizen = require('../../src/platforms/tizen'),
+	common = require('../../src/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');
+
+describe('Tizen project handler', function() {
+	describe('www_dir method', function() {
+		it('should append www to the directory passed in', function() {
+			expect(tizen.www_dir(path.sep)).toEqual(path.join(path.sep, 'www'));
+		});
+	});
+	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");
+			});
+		});
+	});
+});

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/72c3d463/spec/plugins/DummyPlugin/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/plugins/DummyPlugin/plugin.xml b/spec/plugins/DummyPlugin/plugin.xml
index 92a8151..bc71119 100644
--- a/spec/plugins/DummyPlugin/plugin.xml
+++ b/spec/plugins/DummyPlugin/plugin.xml
@@ -161,6 +161,11 @@
         </js-module>
     </platform>
 
+		<!-- tizen -->
+		<platform name="tizen">
+			<source-file src="src/tizen/dummer.js"/>
+		</platform>
+
     <!-- windows8 -->
     <platform name="windows8">
         <config-file target="config.xml" parent="/*">

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/72c3d463/spec/plugins/DummyPlugin/src/tizen/dummer.js
----------------------------------------------------------------------
diff --git a/spec/plugins/DummyPlugin/src/tizen/dummer.js b/spec/plugins/DummyPlugin/src/tizen/dummer.js
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/72c3d463/spec/projects/tizen/www/config.xml
----------------------------------------------------------------------
diff --git a/spec/projects/tizen/www/config.xml b/spec/projects/tizen/www/config.xml
new file mode 100644
index 0000000..788f6d4
--- /dev/null
+++ b/spec/projects/tizen/www/config.xml
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<widget id="TizenTestPackage"></widget>


Mime
View raw message