spec.core.js
This file
Path
spec/spec.core.js
93 lines · 2.1 KiB · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 3863a76 point at it.
Merge branch 'flash'visionmediabefore adoption3863a76
lines 1–93why, 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'11 set('throw exceptions').should.be_null12 set('throw exceptions', true)13 set('throw exceptions').should.be_true14 end15 16 it 'should defer using a function'17 set('root', 'spec')18 set('views', function(){ return set('root') + '/views' })19 set('views').should.eql 'spec/views'20 end21 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