소스 검색

Map tests in progress

Jason Walton 11 년 전
부모
커밋
57127253e9
1개의 변경된 파일27개의 추가작업 그리고 0개의 파일을 삭제
  1. 27 0
      test/lib/pipeline/expressions/MapExpression_test.js

+ 27 - 0
test/lib/pipeline/expressions/MapExpression_test.js

@@ -0,0 +1,27 @@
+"use strict";
+var assert = require("assert"),
+	MapExpression = require("../../../../lib/pipeline/expressions/MapExpression"),
+	Expression = require("../../../../lib/pipeline/expressions/Expression");
+
+// Mocha one-liner to make these tests self-hosted
+if (!module.parent)return(require.cache[__filename] = null, (new (require("mocha"))({ui: "exports", reporter: "spec", grep: process.env.TEST_GREP})).addFile(__filename).run(process.exit));
+
+module.exports = {
+
+	"MapExpression": {
+
+		"constructor()": {
+
+			"should accept 4 arguments": function () {
+				new MapExpression(1, 2, 3, 4);
+			},
+
+			"should not accept less than 4 arguments": function () {
+				assert.throws(function () {new MapExpression()});
+				assert.throws(function () {new MapExpression(1)});
+				assert.throws(function () {new MapExpression(1, 2)});
+				assert.throws(function () {new MapExpression(1, 2, 3)});
+			}
+		}
+	}
+}