Skip to content

Commit

Permalink
tests: use assert instead of should
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Jul 20, 2015
1 parent fb8874a commit cace5eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"devDependencies": {
"istanbul": "0.3.17",
"mocha": "2.2.5",
"should": "~4.0.1",
"supertest": "1.0.1"
},
"files": [
Expand Down
14 changes: 7 additions & 7 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

var assert = require('assert')
var http = require('http')
var request = require('supertest')
var should = require('should')
var vhost = require('..')

describe('vhost(hostname, server)', function(){
Expand Down Expand Up @@ -81,29 +81,29 @@ describe('vhost(hostname, server)', function(){
describe('arguments', function(){
describe('hostname', function(){
it('should be required', function(){
vhost.bind().should.throw(/hostname.*required/)
assert.throws(vhost.bind(), /hostname.*required/)
})

it('should accept string', function(){
vhost.bind(null, 'loki.com', function(){}).should.not.throw()
assert.doesNotThrow(vhost.bind(null, 'loki.com', function(){}))
})

it('should accept RegExp', function(){
vhost.bind(null, /loki\.com/, function(){}).should.not.throw()
assert.doesNotThrow(vhost.bind(null, /loki\.com/, function(){}))
})
})

describe('handle', function(){
it('should be required', function(){
vhost.bind(null, 'loki.com').should.throw(/handle.*required/)
assert.throws(vhost.bind(null, 'loki.com'), /handle.*required/)
})

it('should accept function', function(){
vhost.bind(null, 'loki.com', function(){}).should.not.throw()
assert.doesNotThrow(vhost.bind(null, 'loki.com', function(){}))
})

it('should reject plain object', function(){
vhost.bind(null, 'loki.com', {}).should.throw(/handle.*function/)
assert.throws(vhost.bind(null, 'loki.com', {}), /handle.*function/)
})
})
})
Expand Down

0 comments on commit cace5eb

Please sign in to comment.