Fixed issue #51, added tests to cover levels

This commit is contained in:
Gareth Jones
2012-02-22 14:14:46 +11:00
parent 53367785b4
commit e78f4e33ce
2 changed files with 174 additions and 2 deletions

View File

@@ -31,14 +31,14 @@ Level.prototype.toString = function() {
Level.prototype.isLessThanOrEqualTo = function(otherLevel) {
if (typeof otherLevel === "string") {
otherLevel = Level.toLevel(otherLevel);
otherLevel = toLevel(otherLevel);
}
return this.level <= otherLevel.level;
};
Level.prototype.isGreaterThanOrEqualTo = function(otherLevel) {
if (typeof otherLevel === "string") {
otherLevel = Level.toLevel(otherLevel);
otherLevel = toLevel(otherLevel);
}
return this.level >= otherLevel.level;
};