2 var vows = require('vows')
3 , assert = require('assert')
4 , path = require('path')
5 , sandbox = require('sandboxed-module');
7 vows.describe('log4js-abspath').addBatch({
11 log4js = sandbox.require(
16 appender: function() {},
17 configure: function(configuration, options) {
18 appenderOptions = options;
29 "filename" : "cheesy-wotsits.log"
34 log4js.configure(config, {
35 cwd: '/absolute/path/to'
37 return appenderOptions;
39 'should be passed to appenders during configuration': function(options) {
40 assert.equal(options.cwd, '/absolute/path/to');
47 fileAppender = sandbox.require(
48 '../lib/appenders/file',
63 fileAppender.configure(
65 filename: "whatever.log",
68 { cwd: '/absolute/path/to' }
72 'should prepend options.cwd to config.filename': function(fileOpened) {
73 var expected = path.sep + path.join("absolute", "path", "to", "whatever.log");
74 assert.equal(fileOpened, expected);