Lines Matching refs:message

25      * Formats a message so that it can contain the original assertion message

26 * in addition to the custom message.
27 * @param {String} customMessage The message passed in by the developer.
28 * @param {String} defaultMessage The message created by the error by default.
29 * @return {String} The final error message, containing either or both.
36 return customMessage.replace("{message}", defaultMessage);
78 * @param {String} message (Optional) The message to display with the failure.
82 fail : function (message) {
83 throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, "Test force-failed."));
91 pass : function (message) {
104 * @param {String} message (Optional) The message to display if the assertion fails.
108 areEqual : function (expected, actual, message) {
111 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values should be equal."), expected, actual);
120 * @param {String} message (Optional) The message to display if the assertion fails.
125 message) {
128 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be equal."), unexpected);
137 * @param {String} message (Optional) The message to display if the assertion fails.
141 areNotSame : function (unexpected, actual, message) {
144 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be the same."), unexpected);
153 * @param {String} message (Optional) The message to display if the assertion fails.
157 areSame : function (expected, actual, message) {
160 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values should be the same."), expected, actual);
172 * @param {String} message (Optional) The message to display if the assertion fails.
176 isFalse : function (actual, message) {
179 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be false."), false, actual);
187 * @param {String} message (Optional) The message to display if the assertion fails.
191 isTrue : function (actual, message) {
194 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be true."), true, actual);
206 * @param {String} message (Optional) The message to display if the assertion fails.
210 isNaN : function (actual, message){
213 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be NaN."), NaN, actual);
220 * @param {String} message (Optional) The message to display if the assertion fails.
224 isNotNaN : function (actual, message){
227 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be NaN."), NaN);
235 * @param {String} message (Optional) The message to display if the assertion fails.
239 isNotNull : function (actual, message) {
242 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be null."), null);
250 * @param {String} message (Optional) The message to display if the assertion fails.
254 isNotUndefined : function (actual, message) {
257 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should not be undefined."), undefined);
265 * @param {String} message (Optional) The message to display if the assertion fails.
269 isNull : function (actual, message) {
272 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be null."), null, actual);
280 * @param {String} message (Optional) The message to display if the assertion fails.
284 isUndefined : function (actual, message) {
287 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be undefined."), undefined, actual);
298 * @param {String} message (Optional) The message to display if the assertion fails.
302 isArray : function (actual, message) {
311 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be an array."), actual);
318 * @param {String} message (Optional) The message to display if the assertion fails.
322 isBoolean : function (actual, message) {
325 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a Boolean."), actual);
332 * @param {String} message (Optional) The message to display if the assertion fails.
336 isFunction : function (actual, message) {
339 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a function."), actual);
349 * @param {String} message (Optional) The message to display if the assertion fails.
353 isInstanceOf : function (expected, actual, message) {
356 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value isn't an instance of expected type."), expected, actual);
363 * @param {String} message (Optional) The message to display if the assertion fails.
367 isNumber : function (actual, message) {
370 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a number."), actual);
377 * @param {String} message (Optional) The message to display if the assertion fails.
381 isObject : function (actual, message) {
384 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be an object."), actual);
391 * @param {String} message (Optional) The message to display if the assertion fails.
395 isString : function (actual, message) {
398 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a string."), actual);
406 * @param {String} message (Optional) The message to display if the assertion fails.
410 isTypeOf : function (expectedType, actualValue, message){
413 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be of type " + expectedType + "."), expectedType, typeof actualValue);
425 * is the error message that the error must have; if a function, this
428 * with a specific error message (both must match).
430 * @param {String} message (Optional) The message to display if the assertion
436 throwsError: function(expectedError, method, message){
447 //if it's a string, check the error message
448 if (thrown.message != expectedError){
460 //if it's an object, check the instance and message
462 thrown.message != expectedError.message){
478 throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, "Error should have been thrown."));