initial commit

This commit is contained in:
tmshv committed 2014-02-12 12:36:59 +04:00
commit d3fcd7f10c
3159 files changed
+349702

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
/*!
* Should
* Copyright(c) 2010-2014 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
//var statusCodes = require('http').STATUS_CODES;
module.exports = function(should, Assertion) {
Assertion.add('header', function(field, val) {
this
.have.property('headers')
.and.have.property(field.toLowerCase(), val);
});
Assertion.add('status', function(code) {
//this.params = { operator: 'to have response code ' + code + ' ' + i(statusCodes[code])
// + ', but got ' + this.obj.statusCode + ' ' + i(statusCodes[this.obj.statusCode]) }
this.have.property('statusCode', code);
});
Assertion.add('json', function() {
this.have.property('headers')
.and.have.property('content-type').include('application/json');
}, true);
Assertion.add('html', function() {
this.have.property('headers')
.and.have.property('content-type').include('text/html');
}, true);
};