Reorder server unit test to get more meaningful results

This commit is contained in:
Juan Cruz Viotti 2014-11-14 14:58:56 -04:00
parent 15620145eb
commit 48d39a39f8
2 changed files with 8 additions and 9 deletions

View File

@ -85,10 +85,10 @@ describe 'Data:', ->
expect(value).to.equal(FILESYSTEM.nested.contents)
done()
it 'should return an error if reading an invalid key', (done) ->
it 'should return undefined if reading an invalid key', (done) ->
data.get 'nonexistantkey', encoding: 'utf8', (error, value) ->
expect(error).to.be.an.instanceof(Error)
expect(value).to.not.exist
expect(error).to.not.exist
expect(value).to.be.undefined
done()
it 'should return an error if not reading a file', (done) ->
@ -131,8 +131,8 @@ describe 'Data:', ->
(callback) ->
data.get filename, encoding: 'utf8', (error, value) ->
expect(error).to.be.an.instanceof(Error)
expect(value).to.not.exist
expect(error).to.not.exist
expect(value).to.be.undefined
return callback()
(callback) ->
@ -169,8 +169,8 @@ describe 'Data:', ->
(callback) ->
data.get key, encoding: 'utf8', (error, value) ->
expect(error).to.be.an.instanceof(Error)
expect(value).to.not.exist
expect(error).to.not.exist
expect(value).to.be.undefined
return callback()
], (error) ->

View File

@ -156,9 +156,8 @@ describe 'Server:', ->
it 'should not send the Authorization header', (done) ->
server.request 'GET', URI.ok, null, (error, response) ->
authorizationHeader = response.request.headers.Authorization
expect(error).to.not.exist
authorizationHeader = response.request.headers.Authorization
expect(authorizationHeader).to.not.exist
done()