@@ -11,9 +11,7 @@ describe('Jasmine', function() {
11
11
addMatchers : jasmine . createSpy ( 'addMatchers' ) ,
12
12
provideFallbackReporter : jasmine . createSpy ( 'provideFallbackReporter' ) ,
13
13
execute : jasmine . createSpy ( 'execute' ) ,
14
- throwOnExpectationFailure : jasmine . createSpy ( 'throwOnExpectationFailure' ) ,
15
- stopOnSpecFailure : jasmine . createSpy ( 'stopOnSpecFailure' ) ,
16
- randomizeTests : jasmine . createSpy ( 'randomizeTests' )
14
+ configure : jasmine . createSpy ( 'configure' )
17
15
} ) ,
18
16
Timer : jasmine . createSpy ( 'Timer' )
19
17
} ;
@@ -191,39 +189,39 @@ describe('Jasmine', function() {
191
189
this . configObject . stopSpecOnExpectationFailure = true ;
192
190
this . fixtureJasmine . loadConfig ( this . configObject ) ;
193
191
194
- expect ( this . fixtureJasmine . env . throwOnExpectationFailure ) . toHaveBeenCalledWith ( true ) ;
192
+ expect ( this . fixtureJasmine . env . configure ) . toHaveBeenCalledWith ( { oneFailurePerSpec : true } ) ;
195
193
} ) ;
196
194
197
195
it ( 'does not configure jasmine-core for stopping spec on expectation failure by default' , function ( ) {
198
196
this . fixtureJasmine . loadConfig ( this . configObject ) ;
199
197
200
- expect ( this . fixtureJasmine . env . throwOnExpectationFailure ) . not . toHaveBeenCalled ( ) ;
198
+ expect ( this . fixtureJasmine . env . configure ) . not . toHaveBeenCalled ( ) ;
201
199
} ) ;
202
200
203
201
it ( 'can tell jasmine-core to stop execution when a spec fails' , function ( ) {
204
202
this . configObject . stopOnSpecFailure = true ;
205
203
this . fixtureJasmine . loadConfig ( this . configObject ) ;
206
204
207
- expect ( this . fixtureJasmine . env . stopOnSpecFailure ) . toHaveBeenCalledWith ( true ) ;
205
+ expect ( this . fixtureJasmine . env . configure ) . toHaveBeenCalledWith ( { failFast : true } ) ;
208
206
} ) ;
209
207
210
208
it ( 'does not configure jasmine-core for stopping execution by default' , function ( ) {
211
209
this . fixtureJasmine . loadConfig ( this . configObject ) ;
212
210
213
- expect ( this . fixtureJasmine . env . stopOnSpecFailure ) . not . toHaveBeenCalled ( ) ;
211
+ expect ( this . fixtureJasmine . env . configure ) . not . toHaveBeenCalled ( ) ;
214
212
} ) ;
215
213
216
214
it ( 'can tell jasmine-core to run random specs' , function ( ) {
217
215
this . configObject . random = true ;
218
216
this . fixtureJasmine . loadConfig ( this . configObject ) ;
219
217
220
- expect ( this . fixtureJasmine . env . randomizeTests ) . toHaveBeenCalledWith ( true ) ;
218
+ expect ( this . fixtureJasmine . env . configure ) . toHaveBeenCalledWith ( { random : true } ) ;
221
219
} ) ;
222
220
223
221
it ( 'uses jasmine-core defaults if random is unspecified' , function ( ) {
224
222
this . fixtureJasmine . loadConfig ( this . configObject ) ;
225
223
226
- expect ( this . fixtureJasmine . env . randomizeTests ) . not . toHaveBeenCalled ( ) ;
224
+ expect ( this . fixtureJasmine . env . configure ) . not . toHaveBeenCalled ( ) ;
227
225
} ) ;
228
226
229
227
describe ( 'with options' , function ( ) {
@@ -296,21 +294,21 @@ describe('Jasmine', function() {
296
294
describe ( '#stopSpecOnExpectationFailure' , function ( ) {
297
295
it ( 'sets the throwOnExpectationFailure value on the jasmine-core env' , function ( ) {
298
296
this . testJasmine . stopSpecOnExpectationFailure ( 'foobar' ) ;
299
- expect ( this . testJasmine . env . throwOnExpectationFailure ) . toHaveBeenCalledWith ( 'foobar' ) ;
297
+ expect ( this . testJasmine . env . configure ) . toHaveBeenCalledWith ( { oneFailurePerSpec : 'foobar' } ) ;
300
298
} ) ;
301
299
} ) ;
302
300
303
301
describe ( '#stopOnSpecFailure' , function ( ) {
304
302
it ( 'sets the stopOnSpecFailure value on the jasmine-core env' , function ( ) {
305
303
this . testJasmine . stopOnSpecFailure ( 'blah' ) ;
306
- expect ( this . testJasmine . env . stopOnSpecFailure ) . toHaveBeenCalledWith ( 'blah' ) ;
304
+ expect ( this . testJasmine . env . configure ) . toHaveBeenCalledWith ( { failFast : 'blah' } ) ;
307
305
} ) ;
308
306
} ) ;
309
307
310
308
describe ( '#randomizeTests' , function ( ) {
311
309
it ( 'sets the randomizeTests value on the jasmine-core env' , function ( ) {
312
310
this . testJasmine . randomizeTests ( 'foobar' ) ;
313
- expect ( this . testJasmine . env . randomizeTests ) . toHaveBeenCalledWith ( 'foobar' ) ;
311
+ expect ( this . testJasmine . env . configure ) . toHaveBeenCalledWith ( { random : 'foobar' } ) ;
314
312
} ) ;
315
313
} ) ;
316
314
@@ -401,7 +399,7 @@ describe('Jasmine', function() {
401
399
this . testJasmine . loadConfigFile ( ) ;
402
400
403
401
this . testJasmine . execute ( [ 'spec/fixtures/**/*spec.js' ] , 'interesting spec' ) ;
404
- expect ( this . testJasmine . env . specFilter ) . toEqual ( jasmine . any ( Function ) ) ;
402
+ expect ( this . testJasmine . env . configure ) . toHaveBeenCalledWith ( { specFilter : jasmine . any ( Function ) } ) ;
405
403
} ) ;
406
404
407
405
it ( 'adds an exit code reporter' , function ( ) {
0 commit comments