// ========================================================================== // Project: CoreTest Unit Testing Library // Copyright: ©2010 Apple Inc. All rights reserved. // License: Licened under MIT license (see license.js) // ========================================================================== /*globals Ct CoreTest */ require('../core'); require('./default'); // add Ct.DefaultLogger var utils = require('../utils'); /** DummyLogger simply logs any results into an internal array. Most useful for testing log output then testing the test framework itself. @extends Ct.DefaultLogger */ Ct.DummyLogger = utils.extend(Ct.DefaultLogger, /** @scope Ct.DummyLogger.prototype */{ name: 'dummy', BEGIN: 'begin', END: 'end', TEST: 'test', /** Populated with items describing the log history. Each item in this array witll be a hash contains the following properties: - plan: name of the plan - module: name of the module - test: name of the test - message: message @property {Array} */ history: null, /** Resets the log history */ reset: function() { this.history = []; }, init: function() { Ct.DefaultLogger.prototype.init.apply(this, arguments); this.reset(); }, /** Looks for a message matching a passed template. Returns the message if found or null if none matches. */ find: function(templ) { var hist = this.history, len = hist ? hist.length : 0, idx, item, key, isMatch; for(idx=0;idx