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 <mich...@michaelbrooks.ca>
Authored: Thu Jul 12 22:22:46 2012 -0700
Committer: Michael Brooks <mich...@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();
         });
     });
 });

Reply via email to