Permalink
Browse files

Initial release.

  • Loading branch information...
0 parents commit c052cca15c62692548cd49711501bbbee07f44c4 @Yuffster committed May 14, 2011
Showing with 45 additions and 0 deletions.
  1. BIN .package.json.swp
  2. +32 −0 describe.js
  3. +13 −0 package.json
Binary file not shown.
@@ -0,0 +1,32 @@
+require("string-color");
+describe = function(series, obj) {
+
+ sys.puts(series.toUpperCase().color('yellow')+":");
+
+ var passed = 0, failed = 0, total = 0;
+
+ Object.each(obj, function(test, desc) {
+
+ total++;
+ try {
+ test();
+ } catch (e) {
+ failed++;
+ sys.puts("\t"+desc.color('red'));
+ sys.puts("\t\t====> "+e.stack);
+ return;
+ }
+
+ passed++;
+
+ sys.puts("\t"+desc.color('green'));
+
+ });
+
+ sys.puts(
+ "PASSED".color('green')+": "+passed+
+ " / "+total
+ );
+
+
+};
@@ -0,0 +1,13 @@
+{
+ "name":"describe",
+ "description":"An extremely lightweight method for running tests.",
+ "version":"0.8.0",
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/yuffster/npm-describe"
+ },
+ "dependencies": {
+ "string-color": ">= 0.8.0"
+ },
+ "main": "describe.js"
+}

0 comments on commit c052cca

Please sign in to comment.