Commit 1303dd90 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

point.toString method implemented

parent a3a70e07
......@@ -22,4 +22,12 @@ function Point(x, y) {
}
}
/**
*
* @returns {string}
*/
Point.prototype.toString = function () {
return "[" + this.x + ", " + this.y + "]";
};
module.exports = Point;
......@@ -29,4 +29,10 @@ describe('Point', function () {
});
});
it("toString", function () {
var point = new Point(12, 3);
assert.ok(point.toString().indexOf("12")>=0);
assert.ok(point.toString().indexOf("3")>=0);
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment