You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2014/10/31 07:43:05 UTC
git commit: CB-7915 - Added tests for nopt
Repository: cordova-plugman
Updated Branches:
refs/heads/master 0d92abfed -> 0e69d56d7
CB-7915 - Added tests for nopt
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/0e69d56d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/0e69d56d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/0e69d56d
Branch: refs/heads/master
Commit: 0e69d56d7d228b9260e93b960cf9e9ab40e4c4fb
Parents: 0d92abf
Author: Shazron Abdullah <sh...@apache.org>
Authored: Thu Oct 30 23:42:44 2014 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Thu Oct 30 23:42:44 2014 -0700
----------------------------------------------------------------------
package.json | 6 +++++-
spec/nopt.interface.spec.js | 29 +++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0e69d56d/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index a537c96..69fa203 100644
--- a/package.json
+++ b/package.json
@@ -25,11 +25,15 @@
"rc": "0.5.2"
},
"devDependencies": {
+ "jshint": "2.5.8",
"jasmine-node": "1.14.5"
},
"bin" : { "plugman" : "./main.js" },
"scripts": {
- },
+ "test": "npm run jasmine && npm run jshint",
+ "jshint": "node node_modules/jshint/bin/jshint src",
+ "jasmine": "jasmine-node --captureExceptions --color spec"
+ },
"contributors":[
{
"name":"Anis Kadri"
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0e69d56d/spec/nopt.interface.spec.js
----------------------------------------------------------------------
diff --git a/spec/nopt.interface.spec.js b/spec/nopt.interface.spec.js
new file mode 100644
index 0000000..95f5b22
--- /dev/null
+++ b/spec/nopt.interface.spec.js
@@ -0,0 +1,29 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 nopt = require('nopt');
+
+describe('nopt interface check', function() {
+ // https://issues.apache.org/jira/browse/CB-7915
+ it('parameters without assignment operator should be assigned', function() {
+ var cli_opts = nopt(null, null, ['plugman', 'create', '--name', 'MyName', '--platform_id', 'MyId', '--platform_version','1.0.0']);
+ expect(cli_opts.name).toEqual('MyName');
+ expect(cli_opts.platform_id).toEqual('MyId');
+ expect(cli_opts.platform_version).toEqual('1.0.0');
+ });
+});
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org