Permalink
Browse files

Added a .gitignore file.

Added should.js as dependency.
Added is.equal to assert.js.
Enhanced the README.md file.
  • Loading branch information...
Golo Roden
Golo Roden committed Nov 3, 2011
1 parent 451d112 commit 1da9b71efe091faced93908116e422ea7a6de003
Showing with 27 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +7 −2 README.md
  3. +16 −0 lib/assert.js
  4. +3 −0 package.json
View
@@ -0,0 +1 @@
+*node_modules/
View
@@ -11,10 +11,15 @@ node-assertthat provides a fluent TDD style for Node.js: assert.that(actual, is.
Using node-assertthat is easy. All you need to do is to require it, and then use it:
```javascript
-require('node-assertthat');
+var assert = require('node-assertthat');
+
+var actual =
+ expected = ...;
+
+assert.that(actual, is.equalTo(expected));
```
-Please note that ...
+Please note that node-assertthat extends Node's assert module, i.e. all the code you have been used to will work with node-assertthat as well.
That's it :-)!
View
@@ -0,0 +1,16 @@
+var assert = require('assert'),
+ should = require('should');
+
+exports = module.exports = assert;
+
+is = {
+ equalTo: function(expected) {
+ return function(actual) {
+ actual.should.equal(expected);
+ };
+ }
+};
+
+exports.that = function(actual, constraint) {
+ constraint(actual);
+};
View
@@ -7,5 +7,8 @@
"repository": {
"type": "git",
"url": "https://github.com/goloroden/node-assertthat"
+ },
+ "dependencies": {
+ "should": ">= 0.3.2"
}
}

0 comments on commit 1da9b71

Please sign in to comment.