incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject git commit: adding simple exec-call-on-construction to the network plugin
Date Wed, 07 Mar 2012 18:31:15 GMT
Updated Branches:
  refs/heads/master 26853d4d1 -> e6539d054


adding simple exec-call-on-construction to the network plugin


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/e6539d05
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/e6539d05
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/e6539d05

Branch: refs/heads/master
Commit: e6539d05441ec76b5fbd765cf0421ad88ec06b61
Parents: 26853d4
Author: Fil Maj <maj.fil@gmail.com>
Authored: Wed Mar 7 10:31:10 2012 -0800
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Wed Mar 7 10:31:10 2012 -0800

----------------------------------------------------------------------
 test/test.network.js |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/e6539d05/test/test.network.js
----------------------------------------------------------------------
diff --git a/test/test.network.js b/test/test.network.js
index 5a92fa2..da11ffc 100644
--- a/test/test.network.js
+++ b/test/test.network.js
@@ -1,6 +1,14 @@
 describe("network", function () {
-    var network = require('cordova/plugin/network'),
+    var network,
         exec = require('cordova/exec');
+       
+    it("should fire exec on first-run", function() {
+        exec.reset();
+
+        network = require('cordova/plugin/network');
+
+        expect(exec).toHaveBeenCalledWith(jasmine.any(Function), jasmine.any(Function), "Network
Status", "getConnectionInfo", []);
+    });
 
     //TODO: There is a lot of code executed on the first require call to this plugin
     //      we should refactor or find a good way to call and test this code.


Mime
View raw message