From 2e03ad07489a90e6963fd233a2df8382614bf331 Mon Sep 17 00:00:00 2001 From: csausdev Date: Mon, 6 Dec 2010 18:38:20 +1100 Subject: [PATCH] moved Date tests to vows format --- spec/spec.logging.js | 23 ----------------------- test/logging.js | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/spec/spec.logging.js b/spec/spec.logging.js index 5db5932..7f3ef99 100644 --- a/spec/spec.logging.js +++ b/spec/spec.logging.js @@ -137,12 +137,6 @@ describe 'log4js' end end - describe 'messagePassThroughLayout' - it 'should take a logevent and output only the message' - logger.debug('this is a test'); - log4js.messagePassThroughLayout(event).should.be 'this is a test' - end - end describe 'logLevelFilter' @@ -168,20 +162,3 @@ describe 'log4js' end -describe 'Date' - before - require("log4js"); - end - - describe 'toFormattedString' - it 'should add a toFormattedString method to Date' - var date = new Date(); - date.should.respond_to 'toFormattedString' - end - - it 'should default to a format' - var date = new Date(2010, 0, 11, 14, 31, 30, 5); - date.toFormattedString().should.be '2010-01-11 14:31:30.005' - end - end -end diff --git a/test/logging.js b/test/logging.js index 4e713d9..9b58b04 100644 --- a/test/logging.js +++ b/test/logging.js @@ -325,5 +325,19 @@ vows.describe('log4js').addBatch({ } }), "nonsense"); } + }, + + 'Date extensions': { + topic: function() { + require('../lib/log4js'); + return new Date(2010, 0, 11, 14, 31, 30, 5); + }, + 'should add a toFormattedString method to Date': function(date) { + assert.isFunction(date.toFormattedString); + }, + 'should default to a format': function(date) { + assert.equal(date.toFormattedString(), '2010-01-11 14:31:30.005'); + } } + }).export(module);