Explorar o código

EAGLESIX-3015: Working on unit tests

Jason Walton %!s(int64=11) %!d(string=hai) anos
pai
achega
dc3d350ffc
Modificáronse 1 ficheiros con 28 adicións e 3 borrados
  1. 28 3
      test/lib/pipeline/matcher/Matcher2.js

+ 28 - 3
test/lib/pipeline/matcher/Matcher2.js

@@ -1,9 +1,34 @@
-Matcher = require("../../../../lib/pipeline/matcher/Matcher.js");
+"use strict"
+
+var assert = require("assert"),
+	Matcher2 = require("../../../../lib/pipeline/matcher/Matcher2.js");
 
 module.exports = {
-	"Matcher": {
+	"Matcher2": {
 		"Constructor": function() {
-			var m = new Matcher();
+			//var m = new Matcher2();
+		},
+
+		"Basic": function() {
+			var json = {"a":"b"},
+				m = new Matcher2(json);
+			assert(m.matches(json));
+		},
+
+		"DoubleEqual": function() {
+			var json = {"a":5},
+				m = new Matcher2(json);
+			assert(m.matches(json));
+		},
+
+		"MixedNumericEqual": function() {
+			var query = {"a":5};
+		},
+
+		"MixedNumericGt": function() {
+			var query =  {"a":{"$gt":4}};
 		}
 	}
 }
+
+if (!module.parent)(new(require("mocha"))()).ui("exports").reporter("spec").addFile(__filename).run(process.exit);