ComparisonFailure.js revision 70ed32201807e3e04e8285d8718bf97239ac142d
/**
* ComparisonFailure is subclass of Error that is thrown whenever
* a comparison between two values fails. It provides mechanisms to retrieve
* both the expected and actual value.
*
* @param {String} message The message to display when the error occurs.
* @param {Object} expected The expected value.
* @param {Object} actual The actual value that caused the assertion to fail.
* @namespace Test
* @extends AssertionError
* @class ComparisonFailure
* @constructor
*/
//call superclass
/**
* The expected value.
* @type Object
* @property expected
*/
/**
* The actual value.
* @type Object
* @property actual
*/
/**
* The name of the error that occurred.
* @type String
* @property name
*/
this.name = "ComparisonFailure";
};
//inherit from YUITest.AssertionError
//restore constructor
/**
* Returns a fully formatted error for an assertion failure. This message
* provides information about the expected and actual values.
* @method getMessage
* @return {String} A string describing the error.
*/
};