incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwbro...@apache.org
Subject [35/48] git commit: Add deviceready call to app.report
Date Wed, 01 Aug 2012 16:39:09 GMT
Add deviceready call to app.report


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/commit/ace0f120
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/tree/ace0f120
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/diff/ace0f120

Branch: refs/heads/master
Commit: ace0f120b7dc879f5700345b565b5a99ea63a41c
Parents: 00309d8
Author: Michael Brooks <michael@michaelbrooks.ca>
Authored: Thu Jul 12 22:22:46 2012 -0700
Committer: Michael Brooks <michael@michaelbrooks.ca>
Committed: Thu Jul 12 22:22:46 2012 -0700

----------------------------------------------------------------------
 www/js/index.js   |    3 +++
 www/spec/index.js |   12 ++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/blob/ace0f120/www/js/index.js
----------------------------------------------------------------------
diff --git a/www/js/index.js b/www/js/index.js
index 5b89899..4f26c5a 100644
--- a/www/js/index.js
+++ b/www/js/index.js
@@ -7,6 +7,9 @@ var app = {
     },
     event: {
         deviceready: function() {
+            app.report('deviceready');
         }
+    },
+    report: function(id) {
     }
 };

http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/blob/ace0f120/www/spec/index.js
----------------------------------------------------------------------
diff --git a/www/spec/index.js b/www/spec/index.js
index 63f7a29..d110193 100644
--- a/www/spec/index.js
+++ b/www/spec/index.js
@@ -46,6 +46,18 @@ describe('app', function() {
             it('should exist', function() {
                 expect(app.event.deviceready).toBeDefined();
             });
+
+            it('should report that it fired', function() {
+                spyOn(app, 'report');
+                app.event.deviceready();
+                expect(app.report).toHaveBeenCalledWith('deviceready');
+            });
+        });
+    });
+
+    describe('report', function() {
+        it('should exist', function() {
+            expect(app.report).toBeDefined();
         });
     });
 });


Mime
View raw message