Commit 0643e910 0643e910b4a440d53612701f75e0fac8e330b39d by Chris Winters

passthru context from tester.assertEval and tester.assertEvalEquals to casper.evaluate

1 parent 087f726f
......@@ -146,9 +146,10 @@ var Tester = function(casper, options) {
*
* @param Function fn A function to be evaluated in remote DOM
* @param String message Test description
* @param Object context Object containing the parameters to inject into the function
*/
this.assertEval = function assertEval(fn, message) {
return this.assert(casper.evaluate(fn), message);
this.assertEval = function assertEval(fn, message, context) {
return this.assert(casper.evaluate(fn, context), message);
};
/**
......@@ -158,9 +159,10 @@ var Tester = function(casper, options) {
* @param Function fn The function to be evaluated in remote DOM
* @param Boolean expected The expected value
* @param String message Test description
* @param Object context Object containing the parameters to inject into the function
*/
this.assertEvalEquals = function assertEvalEquals(fn, expected, message) {
return this.assertEquals(casper.evaluate(fn), expected, message);
this.assertEvalEquals = function assertEvalEquals(fn, expected, message, context) {
return this.assertEquals(casper.evaluate(fn, context), expected, message);
};
/**
......@@ -174,6 +176,7 @@ var Tester = function(casper, options) {
return this.assert(casper.exists(selector), message);
};
/**
* Asserts that current HTTP status is the one passed as argument.
*
......