Skip to content
Myr

More Request#error() specs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 6047cd4 · Browse files · 1 file+21 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+21 added−0 removed

  • tests:+21 added−0 removed

1 file+21 added−0 removed

modified:spec/spec.request.js+21 added
267 unmodified lines
268 get('/', headers).body.should.eql 'Internal Server Error'269 get('/', headers).status.should.eql 500270 end271 end272 273 describe 'with "throw exceptions" enabled'274 it 'should re-throw the exception'275 enable('show exceptions')276 enable('throw exceptions')277 get('/', function(){278 this.error(new Error('fail!'))279 })280 -{ get('/') }.should.throw_error Error, 'fail!'281 end282 end283 end284 285 describe 'with "show exceptions" disabled'286 it 'should render the default 500 status body'
4 unmodified lines
291 get('/').body.should.eql 'Internal Server Error'292 get('/').status.should.eql 500293 end294 end295 296 describe 'with "throw exceptions" enabled'297 it 'should re-throw the exception'298 enable('throw exceptions')299 get('/', function(){300 this.error(new Error('fail!'))301 })302 -{ get('/') }.should.throw_error Error, 'fail!'303 end304 end305 end306 307 end308end