File tree Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Original file line number Diff line number Diff line change 1
- fs = require ( 'fs' ) , events = require ( 'events' ) ;
2
-
3
- waitForWriteAndThenReadFile = function ( filename ) {
4
- process . loop ( ) ;
5
- return fs . readFileSync ( filename ) ;
6
- } ;
7
-
8
1
describe 'log4js'
2
+ before
3
+ extend ( context , {
4
+ log4js : require ( "log4js" ) ,
5
+ fs : require ( "fs" ) ,
6
+ waitForWriteAndThenReadFile : function ( filename ) {
7
+ process . loop ( ) ;
8
+ return fs . readFileSync ( filename , "utf8" ) ;
9
+ }
10
+ } ) ;
11
+ end
12
+
9
13
before_each
10
14
log4js . clearAppenders ( ) ;
11
15
event = '' ;
@@ -132,7 +136,7 @@ describe 'log4js'
132
136
try {
133
137
fs. unlinkSync ( './tmp-tests.log' ) ;
134
138
} catch ( e ) {
135
- print ( 'Could not delete tmp-tests.log: ' + e . message ) ;
139
+ // print('Could not delete tmp-tests.log: '+e.message);
136
140
}
137
141
end
138
142
@@ -171,12 +175,12 @@ describe 'log4js'
171
175
try {
172
176
fs. unlinkSync ( './tmp-tests.log' ) ;
173
177
} catch ( e ) {
174
- print ( 'Could not delete tmp-tests.log: ' + e . message ) ;
178
+ // print('Could not delete tmp-tests.log: '+e.message);
175
179
}
176
180
try {
177
181
fs . unlinkSync ( './tmp-tests-warnings.log' ) ;
178
182
} catch ( e ) {
179
- print ( 'Could not delete tmp-tests-warnings.log: ' + e . message ) ;
183
+ // print('Could not delete tmp-tests-warnings.log: '+e.message);
180
184
}
181
185
end
182
186
@@ -207,9 +211,14 @@ describe 'log4js'
207
211
waitForWriteAndThenReadFile ( './tmp-tests-warnings.log' ) . should . be 'both\nboth\n'
208
212
end
209
213
end
214
+
210
215
end
211
216
212
217
describe 'Date'
218
+ before
219
+ require ( "log4js" ) ;
220
+ end
221
+
213
222
describe 'toFormattedString'
214
223
it 'should add a toFormattedString method to Date'
215
224
var date = new Date ( ) ;
Original file line number Diff line number Diff line change 1
1
require . paths . unshift ( "./spec/lib" , "./lib" ) ;
2
2
require ( "jspec" ) ;
3
3
4
- log4js = require ( "log4js-node" ) ;
5
-
6
4
var sys = require ( "sys" ) , fs = require ( "fs" ) ;
7
5
8
6
quit = process . exit
@@ -11,7 +9,7 @@ print = sys.puts
11
9
readFile = function ( path ) {
12
10
var result ;
13
11
try {
14
- result = fs . readFileSync ( path ) ;
12
+ result = fs . readFileSync ( path , "utf8" ) ;
15
13
} catch ( e ) {
16
14
throw e ;
17
15
}
@@ -37,7 +35,7 @@ if (process.ARGV[2]) {
37
35
) ;
38
36
}
39
37
if ( specsFound ) {
40
- JSpec . run ( { reporter : JSpec . reporters . Terminal } ) ;
38
+ JSpec . run ( { reporter : JSpec . reporters . Terminal , failuresOnly : false } ) ;
41
39
JSpec . report ( ) ;
42
40
} else {
43
41
print ( "No tests to run. This makes me sad." ) ;
292F
You can’t perform that action at this time.
0 commit comments