You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by gt...@apache.org on 2012/11/13 20:13:42 UTC

[16/16] js commit: webworks logger test

webworks logger test


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/30e32b95
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/30e32b95
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/30e32b95

Branch: refs/heads/master
Commit: 30e32b951d3e46e2094927903ccc9d16577c35f1
Parents: e67e1a8
Author: Matt Lantz <ma...@rim.com>
Authored: Wed Nov 7 17:32:09 2012 -0500
Committer: Matt Lantz <ma...@rim.com>
Committed: Wed Nov 7 17:42:19 2012 -0500

----------------------------------------------------------------------
 test/blackberry/webworks/test.logger.js |   36 ++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/30e32b95/test/blackberry/webworks/test.logger.js
----------------------------------------------------------------------
diff --git a/test/blackberry/webworks/test.logger.js b/test/blackberry/webworks/test.logger.js
new file mode 100644
index 0000000..38ec7e2
--- /dev/null
+++ b/test/blackberry/webworks/test.logger.js
@@ -0,0 +1,36 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+describe("logger", function () {
+    var logger = require('cordova/plugin/webworks/logger');
+
+    describe("log", function() {
+        it("should post a console log", function() {            
+            spyOn(console, "log");
+            var l = logger.log("Yodalay-Yodalay-Yodalay-Hee-Hoo!");
+            
+            expect(console.log).toHaveBeenCalledWith("Yodalay-Yodalay-Yodalay-Hee-Hoo!");
+        	expect(l.status).toBe(1);
+        	expect(l.message).toBe('Message logged to console: Yodalay-Yodalay-Yodalay-Hee-Hoo!');
+        });
+    });
+
+});