Permalink
Browse files

Updated to include nodeunit integration

  • Loading branch information...
1 parent 8364360 commit d744e809513d48851f910ef08df5df36f31b9150 @robinduckett robinduckett committed Apr 16, 2012
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/integration.js
View
@@ -122,6 +122,29 @@ JsHamcrest.Integration = (function() {
});
};
},
+
+ /**
+ * NodeUnit (Node.js Unit Testing) integration.
+ */
+
+ Nodeunit: function(params) {
+ params = params ? params : {};
+ var target = params.scope || self;
+
+ JsHamcrest.Integration.copyMembers(target);
+
+ target.assertThat = function(actual, matcher, message, test) {
+ return JsHamcrest.Operators.assert(actual, matcher, {
+ message: message,
+ fail: function(message) {
+ test.ok(false, message);
+ },
+ pass: function(message) {
+ test.ok(true, message);
+ }
+ });
+ };
+ },
/**
* JsUnitTest integration.

0 comments on commit d744e80

Please sign in to comment.