Lines Matching refs:message

316      * @param {String} message The message to display if the assertion fails.
318 assert : function (condition, message){
321 throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, "Assertion failed."));
328 * @param {String} message (Optional) The message to display with the failure.
330 fail: function (message) {
331 YUITest.Assert.fail(message);
431 xml += " result=\"" + results.result + "\" message=\"" + xmlEscape(results.message) + "\">";
471 xml += "<failure message=\"" + xmlEscape(results.message) + "\"><![CDATA[" + results.message + "]]></failure>";
552 text = "not " + text + " - " + results.message;
1442 //if it's a string, check the error message
1443 if (thrown.message != shouldError){
1457 //if it's an object, check the instance and message
1459 thrown.message != shouldError.message){
1490 message: error ? error.getMessage() : "Test passed",
1565 message: "Test ignored",
1858 * @param {String} message (Optional) The message to display if the assertion fails.
1863 message) {
1868 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value " + needle + " (" + (typeof needle) + ") not found in array [" + haystack + "]."));
1878 * @param {String} message (Optional) The message to display if the assertion fails.
1883 message) {
1889 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value " + needles[i] + " (" + (typeof needles[i]) + ") not found in array [" + haystack + "]."));
1899 * @param {String} message (Optional) The message to display if the assertion fails.
1904 message) {
1913 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "No match found in array [" + haystack + "]."));
1923 * @param {String} message (Optional) The message to display if the assertion fails.
1928 message) {
1933 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value found in array [" + haystack + "]."));
1943 * @param {String} message (Optional) The message to display if the assertion fails.
1948 message) {
1954 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value found in array [" + haystack + "]."));
1965 * @param {String} message (Optional) The message to display if the assertion fails.
1970 message) {
1980 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value found in array [" + haystack + "]."));
1990 * @param {String} message (Optional) The message to display if the assertion fails.
1994 indexOf : function (needle, haystack, index, message) {
2002 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value exists at index " + i + " but should be at index " + index + "."));
2009 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value doesn't exist in array [" + haystack + "]."));
2019 * @param {String} message (Optional) The message to display if the assertion fails.
2024 message) {
2030 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value should be an array."));
2035 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should have a length of " + expected.length + " but has a length of " + actual.length + "."));
2041 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values in position " + i + " are not equal."), expected[i], actual[i]);
2055 * @param {String} message (Optional) The message to display if the assertion fails.
2061 comparator, message) {
2072 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should have a length of " + expected.length + " but has a length of " + actual.length));
2078 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values in position " + i + " are not equivalent."), expected[i], actual[i]);
2086 * @param {String} message (Optional) The message to display if the assertion fails.
2090 isEmpty : function (actual, message) {
2093 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should be empty."));
2100 * @param {String} message (Optional) The message to display if the assertion fails.
2104 isNotEmpty : function (actual, message) {
2107 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should not be empty."));
2118 * @param {String} message (Optional) The message to display if the assertion fails.
2123 message) {
2129 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should have a length of " + expected.length + " but has a length of " + actual.length));
2135 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values in position " + i + " are not the same."), expected[i], actual[i]);
2147 * @param {String} message (Optional) The message to display if the assertion fails.
2151 lastIndexOf : function (needle, haystack, index, message) {
2157 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value exists at index " + i + " but should be at index " + index + "."));
2164 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value doesn't exist in array."));
2192 * Formats a message so that it can contain the original assertion message
2193 * in addition to the custom message.
2194 * @param {String} customMessage The message passed in by the developer.
2195 * @param {String} defaultMessage The message created by the error by default.
2196 * @return {String} The final error message, containing either or both.
2203 return customMessage.replace("{message}", defaultMessage);
2245 * @param {String} message (Optional) The message to display with the failure.
2249 fail : function (message) {
2250 throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, "Test force-failed."));
2258 pass : function (message) {
2271 * @param {String} message (Optional) The message to display if the assertion fails.
2275 areEqual : function (expected, actual, message) {
2278 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values should be equal."), expected, actual);
2287 * @param {String} message (Optional) The message to display if the assertion fails.
2292 message) {
2295 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be equal."), unexpected);
2304 * @param {String} message (Optional) The message to display if the assertion fails.
2308 areNotSame : function (unexpected, actual, message) {
2311 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be the same."), unexpected);
2320 * @param {String} message (Optional) The message to display if the assertion fails.
2324 areSame : function (expected, actual, message) {
2327 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values should be the same."), expected, actual);
2339 * @param {String} message (Optional) The message to display if the assertion fails.
2343 isFalse : function (actual, message) {
2346 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be false."), false, actual);
2354 * @param {String} message (Optional) The message to display if the assertion fails.
2358 isTrue : function (actual, message) {
2361 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be true."), true, actual);
2373 * @param {String} message (Optional) The message to display if the assertion fails.
2377 isNaN : function (actual, message){
2380 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be NaN."), NaN, actual);
2387 * @param {String} message (Optional) The message to display if the assertion fails.
2391 isNotNaN : function (actual, message){
2394 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be NaN."), NaN);
2402 * @param {String} message (Optional) The message to display if the assertion fails.
2406 isNotNull : function (actual, message) {
2409 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be null."), null);
2417 * @param {String} message (Optional) The message to display if the assertion fails.
2421 isNotUndefined : function (actual, message) {
2424 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should not be undefined."), undefined);
2432 * @param {String} message (Optional) The message to display if the assertion fails.
2436 isNull : function (actual, message) {
2439 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be null."), null, actual);
2447 * @param {String} message (Optional) The message to display if the assertion fails.
2451 isUndefined : function (actual, message) {
2454 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be undefined."), undefined, actual);
2465 * @param {String} message (Optional) The message to display if the assertion fails.
2469 isArray : function (actual, message) {
2478 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be an array."), actual);
2485 * @param {String} message (Optional) The message to display if the assertion fails.
2489 isBoolean : function (actual, message) {
2492 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a Boolean."), actual);
2499 * @param {String} message (Optional) The message to display if the assertion fails.
2503 isFunction : function (actual, message) {
2506 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a function."), actual);
2516 * @param {String} message (Optional) The message to display if the assertion fails.
2520 isInstanceOf : function (expected, actual, message) {
2523 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value isn't an instance of expected type."), expected, actual);
2530 * @param {String} message (Optional) The message to display if the assertion fails.
2534 isNumber : function (actual, message) {
2537 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a number."), actual);
2544 * @param {String} message (Optional) The message to display if the assertion fails.
2548 isObject : function (actual, message) {
2551 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be an object."), actual);
2558 * @param {String} message (Optional) The message to display if the assertion fails.
2562 isString : function (actual, message) {
2565 throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a string."), actual);
2573 * @param {String} message (Optional) The message to display if the assertion fails.
2577 isTypeOf : function (expectedType, actualValue, message){
2580 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be of type " + expectedType + "."), expectedType, typeof actualValue);
2592 * is the error message that the error must have; if a function, this
2595 * with a specific error message (both must match).
2597 * @param {String} message (Optional) The message to display if the assertion
2603 throwsError: function(expectedError, method, message){
2614 //if it's a string, check the error message
2615 if (thrown.message != expectedError){
2627 //if it's an object, check the instance and message
2629 thrown.message != expectedError.message){
2645 throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, "Error should have been thrown."));
2654 * @param {String} message The message to display when the error occurs.
2659 YUITest.AssertionError = function (message){
2662 * Error message. Must be duplicated to ensure browser receives it.
2664 * @property message
2666 this.message = message;
2688 return this.message;
2706 * @param {String} message The message to display when the error occurs.
2714 YUITest.ComparisonFailure = function (message, expected, actual){
2717 YUITest.AssertionError.call(this, message);
2749 * Returns a fully formatted error for an assertion failure. This message
2755 return this.message + "\nExpected: " + this.expected + " (" + (typeof this.expected) + ")" +
2817 * @param {String} message (Optional) The message to display if the assertion fails.
2821 datesAreEqual : function (expected, actual, message){
2842 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, msg), expected, actual);
2853 * @param {String} message (Optional) The message to display if the assertion fails.
2857 timesAreEqual : function (expected, actual, message){
2878 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, msg), expected, actual);
3043 * @param {String} message (Optional) Message to display in case of failure.
3048 YUITest.Mock.Value = function(method, originalArgs, message){
3053 args.push(message);
3057 return new YUITest.Mock.Value(method, originalArgs, message);
3123 * @param {String} message (Optional) The message to display if the assertion fails.
3128 areEqual: function(expected, actual, message) {
3136 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Object should have " + expectedKeys.length + " keys but has " + actualKeys.length));
3143 throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values should be equal for property " + name), expected[name], actual[name]);
3153 * @param {String} message (Optional) The message to display if the assertion fails.
3158 hasKey: function (propertyName, object, message) {
3159 YUITest.ObjectAssert.ownsOrInheritsKey(propertyName, object, message);
3166 * @param {String} message (Optional) The message to display if the assertion fails.
3171 hasKeys: function (properties, object, message) {
3172 YUITest.ObjectAssert.ownsOrInheritsKeys(properties, object, message);
3179 * @param {String} message (Optional) The message to display if the assertion fails.
3183 inheritsKey: function (propertyName, object, message) {
3186 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + propertyName + "' not found on object instance."));
3194 * @param {String} message (Optional) The message to display if the assertion fails.
3198 inheritsKeys: function (properties, object, message) {
3202 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + properties[i] + "' not found on object instance."));
3211 * @param {String} message (Optional) The message to display if the assertion fails.
3215 ownsKey: function (propertyName, object, message) {
3218 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + propertyName + "' not found on object instance."));
3226 * @param {String} message (Optional) The message to display if the assertion fails.
3230 ownsKeys: function (properties, object, message) {
3234 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + properties[i] + "' not found on object instance."));
3242 * @param {String} message (Optional) The message to display if the assertion fails.
3246 ownsNoKeys : function (object, message) {
3257 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Object owns " + count + " properties but should own none."));
3266 * @param {String} message (Optional) The message to display if the assertion fails.
3270 ownsOrInheritsKey: function (propertyName, object, message) {
3273 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + propertyName + "' not found on object."));
3281 * @param {String} message (Optional) The message to display if the assertion fails.
3285 ownsOrInheritsKeys: function (properties, object, message) {
3289 YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + properties[i] + "' not found on object."));
3372 * @param {String} message The message to display when the error occurs.
3378 YUITest.ShouldError = function (message){
3381 YUITest.AssertionError.call(this, message || "This test should have thrown an error but didn't.");
3401 * @param {String} message The message to display when the error occurs.
3407 YUITest.ShouldFail = function (message){
3410 YUITest.AssertionError.call(this, message || "This test should fail but didn't.");
3441 YUITest.AssertionError.call(this, "Unexpected error: " + cause.message);
3477 * @param {String} message The message to display when the error occurs.
3484 YUITest.UnexpectedValue = function (message, unexpected){
3487 YUITest.AssertionError.call(this, message);
3512 * Returns a fully formatted error for an assertion failure. This message
3518 return this.message + "\nUnexpected: " + this.unexpected + " (" + (typeof this.unexpected) + ") ";
3571 * @param {String} message The message to display if the assertion fails.
3575 Y.assert = function(condition, message){
3578 throw new Y.Assert.Error(Y.Assert._formatMessage(message, "Assertion failed."));
3585 * @param {String} message (Optional) The message to display with the failure.
3594 var message = "";
3599 message = "Testing began at " + (new Date()).toString() + ".";
3604 message = Y.substitute("Testing completed at " +
3613 message = event.testName + ": failed.\n" + event.error.getMessage();
3618 message = event.testName + ": ignored.";
3623 message = event.testName + ": passed.";
3628 message = "Test suite \"" + event.testSuite.name + "\" started.";
3633 message = Y.substitute("Test suite \"" +
3642 message = "Test case \"" + event.testCase.name + "\" started.";
3647 message = Y.substitute("Test case \"" +
3655 message = "Unexpected event " + event.type;
3656 message = "info";
3660 Y.log(message, messageType, "TestRunner");