Sha256: ad96c88cb61aeb58dfdb25b19e010e11c4efbd62be0ba0c9699e026211be55df
Contents?: true
Size: 928 Bytes
Versions: 16
Compression:
Stored size: 928 Bytes
Contents
/*! * 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); };
Version data entries
16 entries across 16 versions & 1 rubygems