spec.core.js
This file
Path
spec/spec.core.js
93 lines · 2.1 KiB · JavaScript
Last changed by
Added "throw exceptions" optionsvisionmediabefore adoptionb505c96
History of this fileTake it
The walk stopped after 200 commits: lines older than 521fb0b point at it.
Pre-loading view engine modules to prevent overhead of module loadingvisionmediabefore adoption521fb0b
lines 1–10why, one step back12describe 'Express'3 describe '.version'4 it 'should be properly formatted'5 Express.version.should.match(/^\d+\.\d+\.\d+$/)6 end7 end8 9 describe 'set()'10 it 'should set an option'Added "throw exceptions" optionsvisionmediabefore adoptionb505c96
lines 11–13why, one step back11 set('throw exceptions').should.be_null12 set('throw exceptions', true)13 set('throw exceptions').should.be_truePre-loading view engine modules to prevent overhead of module loadingvisionmediabefore adoption521fb0b
line 14why, one step back14 endAdded spec for defered settings using function literalvisionmediabefore adoption70667cf
lines 15–17why, one step back15 16 it 'should defer using a function'17 set('root', 'spec')set() now allows functionsvisionmediabefore adoption611911e
line 18why, one step back18 set('views', function(){ return set('root') + '/views' })Added spec for defered settings using function literalvisionmediabefore adoption70667cf
lines 19–20why, one step back19 set('views').should.eql 'spec/views'20 endPre-loading view engine modules to prevent overhead of module loadingvisionmediabefore adoption521fb0b
lines 21–93why, one step back21 end22 23 describe 'enable()'24 it 'should enable an option'25 enable('sessions')26 set('sessions').should.be_true27 end28 end29 30 describe 'disable()'31 it 'should disable an option'32 disable('sessions')33 set('sessions').should.be_false34 end35 end36 37 describe 'configure()'38 describe 'given several calls'39 it 'should call them in sequence'40 var order = []41 configure(function(){42 order.push('a')43 })44 configure(function(){45 order.push('b')46 })47 configure('development')48 order.should.eql ['a', 'b']49 end50 51 it 'should call the specific environment only'52 var order = []53 configure('test', function(){54 order.push('a')55 })56 configure('development', function(){57 order.push('b')58 })59 configure('test', function(){60 order.push('c')61 })62 configure('test')63 order.should.eql ['a', 'c']64 end65 66 it 'should call global configurations as well'67 var order = []68 configure(function(){69 order.push('a')70 })71 configure('development', function(){72 order.push('b')73 })74 configure('test', function(){75 order.push('c')76 })77 configure(function(){78 order.push('d')79 })80 configure('test')81 order.should.eql ['a', 'c', 'd']82 end83 end84 85 describe 'given no arguments'86 it 'should throw an error'87 // TODO: tighter spec once JSpec is fixed88 -{ configure() }.should.throw_error89 end90 end91 end92 93end