Comparing version 0.5.0 to 0.5.1
0.5.1 / 2012-01-13 | ||
================== | ||
* Added better `.json` | ||
* Added better `.html` | ||
0.5.0 / 2012-01-12 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -35,3 +35,3 @@ /*! | ||
exports.version = '0.5.0'; | ||
exports.version = '0.5.1'; | ||
@@ -617,3 +617,5 @@ /** | ||
get json() { | ||
this.obj.should.have.header('content-type', 'application/json; charset=utf-8'); | ||
this.obj.should.have.property('headers'); | ||
this.obj.headers.should.have.property('content-type'); | ||
this.obj.headers['content-type'].should.include('application/json'); | ||
}, | ||
@@ -629,3 +631,5 @@ | ||
get html() { | ||
this.obj.should.have.header('content-type', 'text/html; charset=utf-8'); | ||
this.obj.should.have.property('headers'); | ||
this.obj.headers.should.have.property('content-type'); | ||
this.obj.headers['content-type'].should.include('text/html'); | ||
}, | ||
@@ -632,0 +636,0 @@ |
{ "name": "should" | ||
, "description": "test framework agnostic BDD-style assertions" | ||
, "version": "0.5.0" | ||
, "version": "0.5.1" | ||
, "author": "TJ Holowaychuk <tj@vision-media.ca>" | ||
@@ -5,0 +5,0 @@ , "contributors": [ "Aseem Kishore <aseem.kishore@gmail.com>" ] |
@@ -260,3 +260,3 @@ _should_ is an expressive, readable, test framework agnostic, assertion library for [node](http://nodejs.org). | ||
Assert that an object equal to the given `obj` is present in an Array: | ||
Assert that an object equal to the given `obj` is present in an Array: | ||
@@ -269,9 +269,18 @@ [[1],[2],[3]].should.includeEql([3]) | ||
Assert exceptions: | ||
Assert an exception is thrown: | ||
```js | ||
(function(){ | ||
throw new Error('fail'); | ||
}).should.throw(); | ||
``` | ||
Assert an exception is not thrown: | ||
```js | ||
(function(){ | ||
}).should.not.throw(); | ||
``` | ||
Assert exepection message matches string: | ||
@@ -281,5 +290,13 @@ ```js | ||
throw new Error('fail'); | ||
}).should.throw(); | ||
}).should.throw('fail'); | ||
``` | ||
Assert exepection message matches regexp: | ||
```js | ||
(function(){ | ||
throw new Error('failed to foo'); | ||
}).should.throw(/^fail/); | ||
``` | ||
## keys | ||
@@ -286,0 +303,0 @@ |
@@ -243,3 +243,21 @@ | ||
}, | ||
'test .json': function(){ | ||
var req = { | ||
headers: { | ||
'content-type': 'application/json' | ||
} | ||
}; | ||
req.should.be.json; | ||
var req = { | ||
headers: { | ||
'content-type': 'application/json; charset=utf-8' | ||
} | ||
}; | ||
req.should.be.json; | ||
}, | ||
'test equal(val)': function(){ | ||
@@ -246,0 +264,0 @@ 'test'.should.equal('test'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48165
1193
368