cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lorinb...@apache.org
Subject [5/5] git commit: [CB-6296] implemented tests for return interface of create function
Date Mon, 17 Mar 2014 21:20:05 GMT
[CB-6296] implemented tests for return interface of create function


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

Branch: refs/heads/master
Commit: 79e571953c2d3459b459c02eb50e753308fd453d
Parents: 025279a
Author: lorinbeer <lorin@adobe.com>
Authored: Mon Mar 17 14:19:00 2014 -0700
Committer: lorinbeer <lorin@adobe.com>
Committed: Mon Mar 17 14:19:00 2014 -0700

----------------------------------------------------------------------
 spec/create.spec.js | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/79e57195/spec/create.spec.js
----------------------------------------------------------------------
diff --git a/spec/create.spec.js b/spec/create.spec.js
index 0b68d14..ec72104 100644
--- a/spec/create.spec.js
+++ b/spec/create.spec.js
@@ -65,6 +65,35 @@ describe('create command', function () {
         });
     });
 
+    describe('callback', function() {
+        var promise,
+            callback,
+            flag = false;
+
+        beforeEach(function() {
+            callback = function (err) {
+                flag = true;
+            };
+
+            runs(function(){
+                promise = cordova.raw.create(tempDir, 'org.foo', foobar, {}, callback);
+            });
+
+            waitsFor(function(){
+                return flag;
+            });
+        });
+        
+        it('should return null if a callback parameter is used', function() {
+            expect(promise).toBe(null);
+        });
+
+        it('should call the callback function if callback parameter is used', function()
{
+            expect(flag).toBe(true);
+        });
+
+    });
+
     describe('failure', function() {
         it('should return a help message if incorrect number of parameters is used', function(done)
{
             this.after(function() {


Mime
View raw message