Browse Source

EAGLESIX-2691 Added test cases for an argument being passed to the constructor (where none are expected).

Tony Ennis 11 years ago
parent
commit
ff6331cf4c

+ 6 - 1
test/lib/pipeline/expressions/AddExpression_test.js

@@ -15,8 +15,13 @@ module.exports = {
 				assert.doesNotThrow(function(){
 					new AddExpression();
 				});
-			}
+			},
 
+			"should throw Error when constructing with args": function testConstructor(){
+				assert.throws(function(){
+					new AddExpression(1);
+				});
+			}
 		},
 
 		"#getOpName()": {

+ 6 - 0
test/lib/pipeline/expressions/AndExpression_test.js

@@ -14,6 +14,12 @@ module.exports = {
 				assert.doesNotThrow(function(){
 					new AndExpression();
 				});
+			},
+
+			"should throw Error when constructing with args": function testConstructor(){
+				assert.throws(function(){
+					new AndExpression(1);
+				});
 			}
 
 		},

+ 6 - 0
test/lib/pipeline/expressions/MultiplyExpression_test.js

@@ -14,6 +14,12 @@ module.exports = {
 				assert.doesNotThrow(function(){
 					new MultiplyExpression();
 				});
+			},
+
+			"should throw Error when constructing with args": function testConstructor(){
+				assert.throws(function(){
+					new MultiplyExpression(1);
+				});
 			}
 
 		},

+ 6 - 0
test/lib/pipeline/expressions/OrExpression_test.js

@@ -14,6 +14,12 @@ module.exports = {
 				assert.doesNotThrow(function(){
 					new OrExpression();
 				});
+			},
+
+			"should throw Error when constructing with args": function testConstructor(){
+				assert.throws(function(){
+					new OrExpression(1);
+				});
 			}
 
 		},

+ 7 - 1
test/lib/pipeline/expressions/ToLowerExpression_test.js

@@ -14,7 +14,13 @@ module.exports = {
 								assert.doesNotThrow(function() {
 										new ToLowerExpression();
 								});
-						}
+						},
+
+					"should throw Error when constructing with args": function testConstructor(){
+						assert.throws(function(){
+							new ToLowerExpression(1);
+						});
+					}
 
 				},
 

+ 7 - 1
test/lib/pipeline/expressions/ToUpperExpression_test.js

@@ -14,7 +14,13 @@ module.exports = {
 								assert.doesNotThrow(function() {
 										new ToUpperExpression();
 								});
-						}
+						},
+
+					"should throw Error when constructing with args": function testConstructor(){
+						assert.throws(function(){
+							new ToUpperExpression(1);
+						});
+					}
 
 				},