cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwbro...@apache.org
Subject [06/15] git commit: [spec] Add shell script specification.
Date Thu, 14 Nov 2013 00:22:57 GMT
[spec] Add shell script specification.


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

Branch: refs/heads/doclet
Commit: 4da9318a0e37c92216d19328bf476e33512ac98a
Parents: 453936c
Author: Michael Brooks <michael@michaelbrooks.ca>
Authored: Sat Nov 9 22:10:21 2013 -0800
Committer: Michael Brooks <michael@michaelbrooks.ca>
Committed: Sat Nov 9 22:10:21 2013 -0800

----------------------------------------------------------------------
 package.json           |  3 ++-
 spec/bin/index.spec.js | 29 +++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/4da9318a/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 8a36c93..4cce6c6 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,8 @@
         "node": ">=0.10.0"
     },
     "dependencies": {
-        "optimist": "0.6.0"
+        "optimist": "0.6.0",
+        "shelljs": "0.2.6"
     },
     "devDependencies": {
         "jasmine-node": "1.8.0"

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/4da9318a/spec/bin/index.spec.js
----------------------------------------------------------------------
diff --git a/spec/bin/index.spec.js b/spec/bin/index.spec.js
new file mode 100644
index 0000000..8104447
--- /dev/null
+++ b/spec/bin/index.spec.js
@@ -0,0 +1,29 @@
+/*!
+ * Module dependencies.
+ */
+
+var shell = require('shelljs'),
+    path = require('path'),
+    bin,
+    options;
+
+/*!
+ * Shell script specification.
+ */
+
+describe('$ doclet [options] <path>', function() {
+    beforeEach(function() {
+        bin = 'node ' + path.resolve(path.join(__dirname, '..', '..', 'bin'));
+        options = { silent: true };
+        spyOn(process.stdout, 'write');
+    });
+
+    it('should exist', function() {
+        expect(shell.test('-e', bin)).toEqual(true);
+    });
+
+    it('should have exit code 0', function() {
+        var process = shell.exec(bin, options);
+        expect(process.code).toEqual(0);
+    });
+});


Mime
View raw message