@@ -22,6 +22,17 @@ function deleteDirectory(dir) {
22
22
}
23
23
}
24
24
25
+ function withValueForIsTTY ( value , func ) {
26
+ var wasTTY = process . stdout . isTTY ;
27
+ try {
28
+ process . stdout . isTTY = value ;
29
+ func ( ) ;
30
+ } finally {
31
+ process . stdout . isTTY = wasTTY ;
32
+ }
33
+ }
34
+
35
+
25
36
describe ( 'command' , function ( ) {
26
37
beforeEach ( function ( ) {
27
38
var examplesDir = path . resolve ( path . join ( __dirname , 'fixtures' , 'example' ) ) ;
@@ -132,9 +143,11 @@ describe('command', function() {
132
143
133
144
describe ( '--' , function ( ) {
134
145
it ( 'skips anything after it' , function ( ) {
135
- this . command . run ( this . fakeJasmine , [ 'node' , 'bin/jasmine.js' , '--' , '--no-color' ] ) ;
136
- expect ( this . out . getOutput ( ) ) . toBe ( '' ) ;
137
- expect ( this . fakeJasmine . showColors ) . toHaveBeenCalledWith ( true ) ;
146
+ withValueForIsTTY ( true , function ( ) {
147
+ this . command . run ( this . fakeJasmine , [ 'node' , 'bin/jasmine.js' , '--' , '--no-color' ] ) ;
148
+ expect ( this . out . getOutput ( ) ) . toBe ( '' ) ;
149
+ expect ( this . fakeJasmine . showColors ) . toHaveBeenCalledWith ( true ) ;
150
+ } . bind ( this ) ) ;
138
151
} ) ;
139
152
} ) ;
140
153
@@ -158,16 +171,6 @@ describe('command', function() {
158
171
} ) ;
159
172
160
173
describe ( 'running specs' , function ( ) {
161
- var withValueForIsTTY = function ( value , func ) {
162
- var wasTTY = process . stdout . isTTY ;
163
- try {
164
- process . stdout . isTTY = value ;
165
- func ( ) ;
166
- } finally {
167
- process . stdout . isTTY = wasTTY ;
168
- }
169
- } ;
170
-
171
174
beforeEach ( function ( ) {
172
175
this . originalConfigPath = process . env . JASMINE_CONFIG_PATH ;
173
176
} ) ;
0 commit comments