Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

few more tests

  • Loading branch information...
commit 546e8f3e53a9119bdc4cdaf92ac1a844bb32596a 1 parent f516ec8
@bronson authored
Showing with 5 additions and 3 deletions.
  1. +1 −1  README.md
  2. +1 −1  lib/valid.js
  3. +3 −1 test/valid.test.js
View
2  README.md
@@ -3,7 +3,7 @@
A lightweight, chaining validation library.
- Zero dependencies. Can be used in browsers, Node, and Mongo/Couch Map/Reduce functions.
-- Recursively tests JSON data structures.
+- Recursively test JSON data structures.
- Easy to extend with your own validations.
- Excellent test coverage (run `npm test`).
View
2  lib/valid.js
@@ -228,7 +228,7 @@ Valid['false'] = Valid.isFalse;
Valid['in'] = Valid.oneOf;
// composites that take arguments
-Valid.todo = function(name) { return this.fail((name ? name : "this") + " is still todo"); };
+Valid.todo = function(name) { return this.fail((name ? name : "validation") + " is still todo"); };
Valid.notEqual = function(arg) { return this.not(this.equal(arg), "is equal to " + this.Escape(arg)); };
Valid.nomatch = function(pat,mods) { var match = this.match(pat,mods); return this.not(match, "matches " + match._queue[1].data); };
View
4 test/valid.test.js
@@ -26,7 +26,9 @@ Valid.assert("any value", "no validations!");
// utilities
Valid.nop().assert("any value"); // no-op always succeeds
-Valid.fail("die!").assert("anything", "die!"); // fail always fails
+Valid.fail().assert("anything", "failed");
+Valid.fail("die!").assert("anything", "die!");
+Valid.todo().assert("wut", "validation is still todo");
Valid.todo("release 1.0").assert(12, 'release 1.0 is still todo');
Valid.equal(12).message("should be 12").assert(12)
Valid.equal(12).message("should be 12").assert(13, "should be 12")

0 comments on commit 546e8f3

Please sign in to comment.
Something went wrong with that request. Please try again.