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/1e2d5c06 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/1e2d5c06 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/1e2d5c06 Branch: refs/heads/master Commit: 1e2d5c06dfcc0843be51325387b119844127d95f Parents: 68f55ca Author: Matt Lantz <[email protected]> Authored: Wed Nov 7 17:32:09 2012 -0500 Committer: Gord Tanner <[email protected]> Committed: Mon Nov 12 09:42:28 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/1e2d5c06/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!'); + }); + }); + +});
