You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/03/27 13:59:54 UTC
[3/5] git commit: Adding spec for Tizen platform
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/d6f3918b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/d6f3918b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/d6f3918b
Branch: refs/heads/master
Commit: d6f3918b5437ce639fb8b54c9f8d8fdda86c1298
Parents: d1633a3
Author: Gabriel Schulhof <ga...@intel.com>
Authored: Mon Feb 3 16:53:52 2014 +0200
Committer: Gabriel Schulhof <ga...@intel.com>
Committed: Tue Mar 25 23:18:03 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/d6f3918b/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 5ddf316..bda3c2a 100644
--- a/package.json
+++ b/package.json
@@ -34,6 +34,7 @@
"request": "2.22.0"
},
"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/d6f3918b/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/d6f3918b/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/d6f3918b/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/d6f3918b/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>