diff --git a/test/tests/Point.js b/test/tests/Point.js index 9f1fae1d..57d9ceb1 100644 --- a/test/tests/Point.js +++ b/test/tests/Point.js @@ -1,32 +1,27 @@ module('Point'); test('new Point(10, 20)', function() { var point = new Point(10, 20); - equals(point.x, 10); - equals(point.y, 20); + equals(point.toString(), '{ x: 10, y: 20 }'); }); test('new Point([10, 20])', function() { var point = new Point([10, 20]); - equals(point.x, 10); - equals(point.y, 20); + equals(point.toString(), '{ x: 10, y: 20 }'); }); test('new Point({x: 10, y: 20})', function() { var point = new Point({x: 10, y: 20}); - equals(point.x, 10); - equals(point.y, 20); + equals(point.toString(), '{ x: 10, y: 20 }'); }); test('new Point(new Size(10, 20))', function() { var point = new Point(new Size(10, 20)); - equals(point.x, 10); - equals(point.y, 20); + equals(point.toString(), '{ x: 10, y: 20 }'); }); test('new Point({ width: 10, height: 20})', function() { var point = new Point({width: 10, height: 20}); - equals(point.x, 10); - equals(point.y, 20); + equals(point.toString(), '{ x: 10, y: 20 }'); }); test('new Point({ angle: 45, length: 20})', function() { @@ -38,15 +33,13 @@ module('Point vector operations'); test('normalize(length)', function() { var point = new Point(0, 10).normalize(20) - equals(point.x, 0); - equals(point.y, 20); + equals(point.toString(), '{ x: 0, y: 20 }'); }); test('set length', function() { var point = new Point(0, 10); point.length = 20; - equals(point.x, 0); - equals(point.y, 20); + equals(point.toString(), '{ x: 0, y: 20 }'); }); test('get angle', function() { @@ -61,8 +54,7 @@ test('getAngle(point)', function() { test('rotate(degrees)', function() { var point = new Point(100, 50).rotate(90); - equals(Math.round(point.x), -50); - equals(Math.round(point.y), 100); + equals(point.toString(), '{ x: -50, y: 100 }'); }); test('set angle', function() {