Merge pull request #233 from bocoup/improve-same-value

Extend assertion error messages
This commit is contained in:
Brian Terlson 2015-04-21 10:45:17 -07:00
commit c273eb81ce
1 changed files with 12 additions and 2 deletions

View File

@ -25,8 +25,13 @@ assert.sameValue = function (actual, expected, message) {
}
if (message === undefined) {
message = 'Expected SameValue(' + String(actual) + ', ' + String(expected) + ') to be true';
message = '';
} else {
message += ' ';
}
message += 'Expected SameValue(' + String(actual) + ', ' + String(expected) + ') to be true';
$ERROR(message);
};
@ -36,8 +41,13 @@ assert.notSameValue = function (actual, unexpected, message) {
}
if (message === undefined) {
message = 'Expected SameValue(' + String(actual) + ', ' + String(unexpected) + ') to be false';
message = '';
} else {
message += ' ';
}
message += 'Expected SameValue(' + String(actual) + ', ' + String(unexpected) + ') to be false';
$ERROR(message);
};