Skip to content

Commit b356dec

Browse files
author
Gareth Jones
committedMay 25, 2013
Getting my lint on (via bob)
1 parent 8383dfc commit b356dec

File tree

6 files changed

+353
-257
lines changed

6 files changed

+353
-257
lines changed
 

‎.bob.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"build": "clean lint coverage test",
3+
"lint": {
4+
"type": "jshint"
5+
},
6+
"coverage": {
7+
"type": "vows"
8+
},
9+
"test": {
10+
"type": "vows"
11+
}
12+
}

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
build
44
node_modules
55

6+
.bob/

‎.jshintrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"node": true,
3+
"laxcomma": true,
4+
"indent": 2,
5+
"globalstrict": true,
6+
"maxparams": 5,
7+
"maxdepth": 3,
8+
"maxstatements": 20,
9+
"maxcomplexity": 5,
10+
"maxlen": 100,
11+
"globals": {
12+
"describe": true,
13+
"it": true
14+
}
15+
}

‎lib/appenders/console.js

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
var layouts = require('../layouts'),
2-
consoleLog = console.log;
1+
"use strict";
2+
var layouts = require('../layouts')
3+
, consoleLog = console.log;
34

45
function consoleAppender (layout) {
5-
layout = layout || layouts.colouredLayout;
6-
return function(loggingEvent) {
7-
consoleLog(layout(loggingEvent));
8-
};
6+
layout = layout || layouts.colouredLayout;
7+
return function(loggingEvent) {
8+
consoleLog(layout(loggingEvent));
9+
};
910
}
1011

1112
function configure(config) {
12-
var layout;
13-
if (config.layout) {
14-
layout = layouts.layout(config.layout.type, config.layout);
15-
}
16-
return consoleAppender(layout);
13+
var layout;
14+
if (config.layout) {
15+
layout = layouts.layout(config.layout.type, config.layout);
16+
}
17+
return consoleAppender(layout);
1718
}
1819

1920
exports.appender = consoleAppender;
+187-147
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var vows = require('vows')
23
, assert = require('assert')
34
, fs = require('fs')
@@ -11,177 +12,216 @@ if (semver.satisfies(process.version, '>=0.10.0')) {
1112
} else {
1213
streams = require('readable-stream');
1314
}
14-
DateRollingFileStream = require('../../lib/streams').DateRollingFileStream
15+
DateRollingFileStream = require('../../lib/streams').DateRollingFileStream;
1516

1617
function cleanUp(filename) {
17-
return function() {
18-
fs.unlink(filename);
19-
};
18+
return function() {
19+
fs.unlink(filename);
20+
};
2021
}
2122

2223
function now() {
23-
return testTime.getTime();
24+
return testTime.getTime();
2425
}
2526

2627
vows.describe('DateRollingFileStream').addBatch({
27-
'arguments': {
28-
topic: new DateRollingFileStream(__dirname + '/test-date-rolling-file-stream-1', 'yyyy-mm-dd.hh'),
29-
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-1'),
30-
31-
'should take a filename and a pattern and return a WritableStream': function(stream) {
32-
assert.equal(stream.filename, __dirname + '/test-date-rolling-file-stream-1');
33-
assert.equal(stream.pattern, 'yyyy-mm-dd.hh');
34-
assert.instanceOf(stream, streams.Writable);
35-
},
36-
'with default settings for the underlying stream': function(stream) {
37-
assert.equal(stream.theStream.mode, 420);
38-
assert.equal(stream.theStream.flags, 'a');
39-
//encoding is not available on the underlying stream
40-
//assert.equal(stream.encoding, 'utf8');
41-
}
28+
'arguments': {
29+
topic: new DateRollingFileStream(
30+
__dirname + '/test-date-rolling-file-stream-1',
31+
'yyyy-mm-dd.hh'
32+
),
33+
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-1'),
34+
35+
'should take a filename and a pattern and return a WritableStream': function(stream) {
36+
assert.equal(stream.filename, __dirname + '/test-date-rolling-file-stream-1');
37+
assert.equal(stream.pattern, 'yyyy-mm-dd.hh');
38+
assert.instanceOf(stream, streams.Writable);
4239
},
43-
44-
'default arguments': {
45-
topic: new DateRollingFileStream(__dirname + '/test-date-rolling-file-stream-2'),
46-
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-2'),
47-
48-
'pattern should be .yyyy-MM-dd': function(stream) {
49-
assert.equal(stream.pattern, '.yyyy-MM-dd');
50-
}
40+
'with default settings for the underlying stream': function(stream) {
41+
assert.equal(stream.theStream.mode, 420);
42+
assert.equal(stream.theStream.flags, 'a');
43+
//encoding is not available on the underlying stream
44+
//assert.equal(stream.encoding, 'utf8');
45+
}
46+
},
47+
48+
'default arguments': {
49+
topic: new DateRollingFileStream(__dirname + '/test-date-rolling-file-stream-2'),
50+
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-2'),
51+
52+
'pattern should be .yyyy-MM-dd': function(stream) {
53+
assert.equal(stream.pattern, '.yyyy-MM-dd');
54+
}
55+
},
56+
57+
'with stream arguments': {
58+
topic: new DateRollingFileStream(
59+
__dirname + '/test-date-rolling-file-stream-3',
60+
'yyyy-MM-dd',
61+
{ mode: parseInt('0666', 8) }
62+
),
63+
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-3'),
64+
65+
'should pass them to the underlying stream': function(stream) {
66+
assert.equal(stream.theStream.mode, parseInt('0666', 8));
67+
}
68+
},
69+
70+
'with stream arguments but no pattern': {
71+
topic: new DateRollingFileStream(
72+
__dirname + '/test-date-rolling-file-stream-4',
73+
{ mode: parseInt('0666', 8) }
74+
),
75+
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-4'),
76+
77+
'should pass them to the underlying stream': function(stream) {
78+
assert.equal(stream.theStream.mode, parseInt('0666', 8));
5179
},
52-
53-
'with stream arguments': {
54-
topic: new DateRollingFileStream(__dirname + '/test-date-rolling-file-stream-3', 'yyyy-MM-dd', { mode: 0666 }),
55-
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-3'),
56-
57-
'should pass them to the underlying stream': function(stream) {
58-
assert.equal(stream.theStream.mode, 0666);
59-
}
80+
'should use default pattern': function(stream) {
81+
assert.equal(stream.pattern, '.yyyy-MM-dd');
82+
}
83+
},
84+
85+
'with a pattern of .yyyy-MM-dd': {
86+
topic: function() {
87+
var that = this,
88+
stream = new DateRollingFileStream(
89+
__dirname + '/test-date-rolling-file-stream-5', '.yyyy-MM-dd',
90+
null,
91+
now
92+
);
93+
stream.write("First message\n", 'utf8', function() {
94+
that.callback(null, stream);
95+
});
96+
},
97+
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-5'),
98+
99+
'should create a file with the base name': {
100+
topic: function(stream) {
101+
fs.readFile(__dirname + '/test-date-rolling-file-stream-5', this.callback);
102+
},
103+
'file should contain first message': function(result) {
104+
assert.equal(result.toString(), "First message\n");
105+
}
60106
},
61107

62-
'with stream arguments but no pattern': {
63-
topic: new DateRollingFileStream(__dirname + '/test-date-rolling-file-stream-4', { mode: 0666 }),
64-
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-4'),
108+
'when the day changes': {
109+
topic: function(stream) {
110+
testTime = new Date(2012, 8, 13, 0, 10, 12);
111+
stream.write("Second message\n", 'utf8', this.callback);
112+
},
113+
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-5.2012-09-12'),
65114

66-
'should pass them to the underlying stream': function(stream) {
67-
assert.equal(stream.theStream.mode, 0666);
115+
116+
'the number of files': {
117+
topic: function() {
118+
fs.readdir(__dirname, this.callback);
68119
},
69-
'should use default pattern': function(stream) {
70-
assert.equal(stream.pattern, '.yyyy-MM-dd');
120+
'should be two': function(files) {
121+
assert.equal(
122+
files.filter(
123+
function(file) {
124+
return file.indexOf('test-date-rolling-file-stream-5') > -1;
125+
}
126+
).length,
127+
2
128+
);
71129
}
72-
},
73-
74-
'with a pattern of .yyyy-MM-dd': {
130+
},
131+
132+
'the file without a date': {
75133
topic: function() {
76-
var that = this,
77-
stream = new DateRollingFileStream(__dirname + '/test-date-rolling-file-stream-5', '.yyyy-MM-dd', null, now);
78-
stream.write("First message\n", 'utf8', function() {
79-
that.callback(null, stream);
80-
});
134+
fs.readFile(__dirname + '/test-date-rolling-file-stream-5', this.callback);
81135
},
82-
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-5'),
83-
84-
'should create a file with the base name': {
85-
topic: function(stream) {
86-
fs.readFile(__dirname + '/test-date-rolling-file-stream-5', this.callback);
87-
},
88-
'file should contain first message': function(result) {
89-
assert.equal(result.toString(), "First message\n");
90-
}
136+
'should contain the second message': function(contents) {
137+
assert.equal(contents.toString(), "Second message\n");
138+
}
139+
},
140+
141+
'the file with the date': {
142+
topic: function() {
143+
fs.readFile(__dirname + '/test-date-rolling-file-stream-5.2012-09-12', this.callback);
91144
},
92-
93-
'when the day changes': {
94-
topic: function(stream) {
95-
testTime = new Date(2012, 8, 13, 0, 10, 12);
96-
stream.write("Second message\n", 'utf8', this.callback);
97-
},
98-
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-5.2012-09-12'),
99-
100-
101-
'the number of files': {
102-
topic: function() {
103-
fs.readdir(__dirname, this.callback);
104-
},
105-
'should be two': function(files) {
106-
assert.equal(files.filter(function(file) { return file.indexOf('test-date-rolling-file-stream-5') > -1; }).length, 2);
107-
}
108-
},
109-
110-
'the file without a date': {
111-
topic: function() {
112-
fs.readFile(__dirname + '/test-date-rolling-file-stream-5', this.callback);
113-
},
114-
'should contain the second message': function(contents) {
115-
assert.equal(contents.toString(), "Second message\n");
116-
}
117-
},
118-
119-
'the file with the date': {
120-
topic: function() {
121-
fs.readFile(__dirname + '/test-date-rolling-file-stream-5.2012-09-12', this.callback);
122-
},
123-
'should contain the first message': function(contents) {
124-
assert.equal(contents.toString(), "First message\n");
125-
}
126-
}
145+
'should contain the first message': function(contents) {
146+
assert.equal(contents.toString(), "First message\n");
127147
}
148+
}
149+
}
150+
},
151+
152+
'with alwaysIncludePattern': {
153+
topic: function() {
154+
var that = this,
155+
testTime = new Date(2012, 8, 12, 0, 10, 12),
156+
stream = new DateRollingFileStream(
157+
__dirname + '/test-date-rolling-file-stream-pattern',
158+
'.yyyy-MM-dd',
159+
{alwaysIncludePattern: true},
160+
now
161+
);
162+
stream.write("First message\n", 'utf8', function() {
163+
that.callback(null, stream);
164+
});
128165
},
129-
130-
'with alwaysIncludePattern': {
166+
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-pattern.2012-09-12'),
167+
168+
'should create a file with the pattern set': {
169+
topic: function(stream) {
170+
fs.readFile(__dirname + '/test-date-rolling-file-stream-pattern.2012-09-12', this.callback);
171+
},
172+
'file should contain first message': function(result) {
173+
assert.equal(result.toString(), "First message\n");
174+
}
175+
},
176+
177+
'when the day changes': {
178+
topic: function(stream) {
179+
testTime = new Date(2012, 8, 13, 0, 10, 12);
180+
stream.write("Second message\n", 'utf8', this.callback);
181+
},
182+
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-pattern.2012-09-13'),
183+
184+
185+
'the number of files': {
131186
topic: function() {
132-
var that = this,
133-
testTime = new Date(2012, 8, 12, 0, 10, 12),
134-
stream = new DateRollingFileStream(__dirname + '/test-date-rolling-file-stream-pattern', '.yyyy-MM-dd', {alwaysIncludePattern: true}, now);
135-
stream.write("First message\n", 'utf8', function() {
136-
that.callback(null, stream);
137-
});
187+
fs.readdir(__dirname, this.callback);
138188
},
139-
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-pattern.2012-09-12'),
140-
141-
'should create a file with the pattern set': {
142-
topic: function(stream) {
143-
fs.readFile(__dirname + '/test-date-rolling-file-stream-pattern.2012-09-12', this.callback);
144-
},
145-
'file should contain first message': function(result) {
146-
assert.equal(result.toString(), "First message\n");
147-
}
189+
'should be two': function(files) {
190+
assert.equal(
191+
files.filter(
192+
function(file) {
193+
return file.indexOf('test-date-rolling-file-stream-pattern') > -1;
194+
}
195+
).length,
196+
2
197+
);
198+
}
199+
},
200+
201+
'the file with the later date': {
202+
topic: function() {
203+
fs.readFile(
204+
__dirname + '/test-date-rolling-file-stream-pattern.2012-09-13',
205+
this.callback
206+
);
148207
},
149-
150-
'when the day changes': {
151-
topic: function(stream) {
152-
testTime = new Date(2012, 8, 13, 0, 10, 12);
153-
stream.write("Second message\n", 'utf8', this.callback);
154-
},
155-
teardown: cleanUp(__dirname + '/test-date-rolling-file-stream-pattern.2012-09-13'),
156-
157-
158-
'the number of files': {
159-
topic: function() {
160-
fs.readdir(__dirname, this.callback);
161-
},
162-
'should be two': function(files) {
163-
assert.equal(files.filter(function(file) { return file.indexOf('test-date-rolling-file-stream-pattern') > -1; }).length, 2);
164-
}
165-
},
166-
167-
'the file with the later date': {
168-
topic: function() {
169-
fs.readFile(__dirname + '/test-date-rolling-file-stream-pattern.2012-09-13', this.callback);
170-
},
171-
'should contain the second message': function(contents) {
172-
assert.equal(contents.toString(), "Second message\n");
173-
}
174-
},
175-
176-
'the file with the date': {
177-
topic: function() {
178-
fs.readFile(__dirname + '/test-date-rolling-file-stream-pattern.2012-09-12', this.callback);
179-
},
180-
'should contain the first message': function(contents) {
181-
assert.equal(contents.toString(), "First message\n");
182-
}
183-
}
208+
'should contain the second message': function(contents) {
209+
assert.equal(contents.toString(), "Second message\n");
210+
}
211+
},
212+
213+
'the file with the date': {
214+
topic: function() {
215+
fs.readFile(
216+
__dirname + '/test-date-rolling-file-stream-pattern.2012-09-12',
217+
this.callback
218+
);
219+
},
220+
'should contain the first message': function(contents) {
221+
assert.equal(contents.toString(), "First message\n");
184222
}
223+
}
185224
}
225+
}
186226

187227
}).exportTo(module);
+126-99
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict";
12
var vows = require('vows')
23
, async = require('async')
34
, assert = require('assert')
@@ -15,120 +16,146 @@ if (semver.satisfies(process.version, '>=0.10.0')) {
1516
RollingFileStream = require('../../lib/streams').RollingFileStream;
1617

1718
function remove(filename) {
18-
try {
19-
fs.unlinkSync(filename);
20-
} catch (e) {
21-
//doesn't really matter if it failed
22-
}
19+
try {
20+
fs.unlinkSync(filename);
21+
} catch (e) {
22+
//doesn't really matter if it failed
23+
}
2324
}
2425

2526
vows.describe('RollingFileStream').addBatch({
26-
'arguments': {
27-
topic: function() {
28-
remove(__dirname + "/test-rolling-file-stream");
29-
return new RollingFileStream("test-rolling-file-stream", 1024, 5);
30-
},
31-
'should take a filename, file size in bytes, number of backups as arguments and return a Writable': function(stream) {
32-
assert.instanceOf(stream, streams.Writable);
33-
assert.equal(stream.filename, "test-rolling-file-stream");
34-
assert.equal(stream.size, 1024);
35-
assert.equal(stream.backups, 5);
36-
},
37-
'with default settings for the underlying stream': function(stream) {
38-
assert.equal(stream.theStream.mode, 420);
39-
assert.equal(stream.theStream.flags, 'a');
40-
//encoding isn't a property on the underlying stream
41-
//assert.equal(stream.theStream.encoding, 'utf8');
42-
}
27+
'arguments': {
28+
topic: function() {
29+
remove(__dirname + "/test-rolling-file-stream");
30+
return new RollingFileStream("test-rolling-file-stream", 1024, 5);
4331
},
44-
'with stream arguments': {
45-
topic: function() {
46-
remove(__dirname + '/test-rolling-file-stream');
47-
return new RollingFileStream('test-rolling-file-stream', 1024, 5, { mode: 0666 });
48-
},
49-
'should pass them to the underlying stream': function(stream) {
50-
assert.equal(stream.theStream.mode, 0666);
51-
}
32+
'should take a filename, file size (bytes), no. backups, return Writable': function(stream) {
33+
assert.instanceOf(stream, streams.Writable);
34+
assert.equal(stream.filename, "test-rolling-file-stream");
35+
assert.equal(stream.size, 1024);
36+
assert.equal(stream.backups, 5);
5237
},
53-
'without size': {
54-
topic: function() {
55-
try {
56-
new RollingFileStream(__dirname + "/test-rolling-file-stream");
57-
} catch (e) {
58-
return e;
59-
}
60-
},
61-
'should throw an error': function(err) {
62-
assert.instanceOf(err, Error);
63-
}
38+
'with default settings for the underlying stream': function(stream) {
39+
assert.equal(stream.theStream.mode, 420);
40+
assert.equal(stream.theStream.flags, 'a');
41+
//encoding isn't a property on the underlying stream
42+
//assert.equal(stream.theStream.encoding, 'utf8');
43+
}
44+
},
45+
'with stream arguments': {
46+
topic: function() {
47+
remove(__dirname + '/test-rolling-file-stream');
48+
return new RollingFileStream(
49+
'test-rolling-file-stream',
50+
1024,
51+
5,
52+
{ mode: parseInt('0666', 8) }
53+
);
6454
},
65-
'without number of backups': {
66-
topic: function() {
67-
remove('test-rolling-file-stream');
68-
return new RollingFileStream(__dirname + "/test-rolling-file-stream", 1024);
69-
},
70-
'should default to 1 backup': function(stream) {
71-
assert.equal(stream.backups, 1);
72-
}
55+
'should pass them to the underlying stream': function(stream) {
56+
assert.equal(stream.theStream.mode, parseInt('0666', 8));
57+
}
58+
},
59+
'without size': {
60+
topic: function() {
61+
try {
62+
new RollingFileStream(__dirname + "/test-rolling-file-stream");
63+
} catch (e) {
64+
return e;
65+
}
66+
},
67+
'should throw an error': function(err) {
68+
assert.instanceOf(err, Error);
69+
}
70+
},
71+
'without number of backups': {
72+
topic: function() {
73+
remove('test-rolling-file-stream');
74+
return new RollingFileStream(__dirname + "/test-rolling-file-stream", 1024);
7375
},
74-
'writing less than the file size': {
76+
'should default to 1 backup': function(stream) {
77+
assert.equal(stream.backups, 1);
78+
}
79+
},
80+
'writing less than the file size': {
81+
topic: function() {
82+
remove(__dirname + "/test-rolling-file-stream-write-less");
83+
var that = this
84+
, stream = new RollingFileStream(
85+
__dirname + "/test-rolling-file-stream-write-less",
86+
100
87+
);
88+
stream.write("cheese", "utf8", function() {
89+
stream.end();
90+
fs.readFile(__dirname + "/test-rolling-file-stream-write-less", "utf8", that.callback);
91+
});
92+
},
93+
'should write to the file': function(contents) {
94+
assert.equal(contents, "cheese");
95+
},
96+
'the number of files': {
7597
topic: function() {
76-
remove(__dirname + "/test-rolling-file-stream-write-less");
77-
var that = this, stream = new RollingFileStream(__dirname + "/test-rolling-file-stream-write-less", 100);
78-
stream.write("cheese", "utf8", function() {
79-
stream.end();
80-
fs.readFile(__dirname + "/test-rolling-file-stream-write-less", "utf8", that.callback);
81-
});
98+
fs.readdir(__dirname, this.callback);
8299
},
83-
'should write to the file': function(contents) {
84-
assert.equal(contents, "cheese");
85-
},
86-
'the number of files': {
87-
topic: function() {
88-
fs.readdir(__dirname, this.callback);
89-
},
90-
'should be one': function(files) {
91-
assert.equal(files.filter(function(file) { return file.indexOf('test-rolling-file-stream-write-less') > -1; }).length, 1);
92-
}
100+
'should be one': function(files) {
101+
assert.equal(
102+
files.filter(
103+
function(file) {
104+
return file.indexOf('test-rolling-file-stream-write-less') > -1;
105+
}
106+
).length,
107+
1
108+
);
93109
}
110+
}
111+
},
112+
'writing more than the file size': {
113+
topic: function() {
114+
remove(__dirname + "/test-rolling-file-stream-write-more");
115+
remove(__dirname + "/test-rolling-file-stream-write-more.1");
116+
var that = this
117+
, stream = new RollingFileStream(
118+
__dirname + "/test-rolling-file-stream-write-more",
119+
45
120+
);
121+
async.forEach(
122+
[0, 1, 2, 3, 4, 5, 6],
123+
function(i, cb) {
124+
stream.write(i +".cheese\n", "utf8", cb);
125+
},
126+
function() {
127+
stream.end();
128+
that.callback();
129+
}
130+
);
94131
},
95-
'writing more than the file size': {
132+
'the number of files': {
96133
topic: function() {
97-
remove(__dirname + "/test-rolling-file-stream-write-more");
98-
remove(__dirname + "/test-rolling-file-stream-write-more.1");
99-
var that = this, stream = new RollingFileStream(__dirname + "/test-rolling-file-stream-write-more", 45);
100-
async.forEach([0, 1, 2, 3, 4, 5, 6], function(i, cb) {
101-
stream.write(i +".cheese\n", "utf8", cb);
102-
}, function() {
103-
stream.end();
104-
that.callback();
105-
});
134+
fs.readdir(__dirname, this.callback);
106135
},
107-
'the number of files': {
108-
topic: function() {
109-
fs.readdir(__dirname, this.callback);
110-
},
111-
'should be two': function(files) {
112-
assert.equal(files.filter(
113-
function(file) { return file.indexOf('test-rolling-file-stream-write-more') > -1; }
114-
).length, 2);
115-
}
136+
'should be two': function(files) {
137+
assert.equal(files.filter(
138+
function(file) {
139+
return file.indexOf('test-rolling-file-stream-write-more') > -1;
140+
}
141+
).length, 2);
142+
}
143+
},
144+
'the first file': {
145+
topic: function() {
146+
fs.readFile(__dirname + "/test-rolling-file-stream-write-more", "utf8", this.callback);
116147
},
117-
'the first file': {
118-
topic: function() {
119-
fs.readFile(__dirname + "/test-rolling-file-stream-write-more", "utf8", this.callback);
120-
},
121-
'should contain the last two log messages': function(contents) {
122-
assert.equal(contents, '5.cheese\n6.cheese\n');
123-
}
148+
'should contain the last two log messages': function(contents) {
149+
assert.equal(contents, '5.cheese\n6.cheese\n');
150+
}
151+
},
152+
'the second file': {
153+
topic: function() {
154+
fs.readFile(__dirname + '/test-rolling-file-stream-write-more.1', "utf8", this.callback);
124155
},
125-
'the second file': {
126-
topic: function() {
127-
fs.readFile(__dirname + '/test-rolling-file-stream-write-more.1', "utf8", this.callback);
128-
},
129-
'should contain the first five log messages': function(contents) {
130-
assert.equal(contents, '0.cheese\n1.cheese\n2.cheese\n3.cheese\n4.cheese\n');
131-
}
156+
'should contain the first five log messages': function(contents) {
157+
assert.equal(contents, '0.cheese\n1.cheese\n2.cheese\n3.cheese\n4.cheese\n');
132158
}
133159
}
160+
}
134161
}).exportTo(module);

0 commit comments

Comments
 (0)
Please sign in to comment.