spec.core.js
This file
Path
spec/spec.core.js
49 lines · 1.2 KiB · JavaScript
Last changed by
Added Express.hashToArray()visionmediabefore adoption3dfe6c0
History of this fileTake it
12describe 'Express'Setting up specsvisionmediabefore adoption0d81d0b
lines 3–7why, one step back3 describe '.version'4 it 'should be properly formatted'5 Express.version.should.match /\d+\.\d+\.\d+/6 end7 endAdded spec for Express.contentsOf()visionmediabefore adoptionafde985
lines 8–13why, one step back8 9 describe '.contentsOf()'10 it 'should return the body of a function as a string'11 Express.contentsOf(function(){ return 'foo' }).should.include 'return', 'foo'12 end13 endAdded Express.header()visionmediabefore adoption3b3be54
lines 14–20why, one step back14 15 describe '.header()'16 it 'should set / get headers'17 Express.header('Content-Type', 'text/html')18 Express.header('Content-Type').should.eql 'text/html'19 end20 endAdded Express.status() and specsvisionmediabefore adoptionaa01cc2
lines 21–41why, one step back21 22 describe '.status()'23 after_each24 Express.response.status = 20025 end26 27 it 'should set response status code by number'28 Express.status(404)29 Express.response.status.should.eql 40430 end31 32 it 'should set using the status string map'33 Express.status('Not Found')34 Express.response.status.should.eql 40435 end36 37 it 'should be case insensitive'38 Express.status('forbidden')39 Express.response.status.should.eql 40340 end41 endAdded Express.hashToArray()visionmediabefore adoption3dfe6c0
lines 42–48why, one step back42 43 describe '.hashToArray()'44 it 'should map hash key / value pairs to an array'45 headers = { 'Content-Type' : 'text/plain' }46 Express.hashToArray(headers).should.eql [['Content-Type', 'text/plain']]47 end48 end49end