module('Path Drawing Commands');

test('path.lineTo(point);', function() {
	var path = new Path();
	path.moveTo([50, 50]);
	path.lineTo([100, 100]);
	equals(path.segments.toString(), '{ point: { x: 50, y: 50 } },{ point: { x: 100, y: 100 } }');
});

test('path.arcTo(from, through, to);', function() {
	var path = new Path();
	console.log(path.segments);
	path.moveTo([0, 20]);
	path.arcTo([75, 75], [100, 0]);
	equals(path.segments.toString(), '{ point: { x: 0, y: 20 }, handleOut: { x: -2.62559, y: 23.01251 } },{ point: { x: 30.89325, y: 74.75812 }, handleIn: { x: -21.05455, y: -9.65273 }, handleOut: { x: 21.05455, y: 9.65273 } },{ point: { x: 92.54397, y: 62.42797 }, handleIn: { x: -15.72238, y: 17.00811 }, handleOut: { x: 15.72238, y: -17.00811 } },{ point: { x: 100, y: 0 }, handleIn: { x: 11.27458, y: 20.23247 } }');
});

test('path.arcTo(from, through, to); where from, through and to all share the same y position and through lies in between from and to', function() {
	var path = new Path();
	path.strokeColor = 'black';

	path.add([40, 75]);
	path.arcTo([50, 75], [100, 75]);
	equals(path.lastSegment.point.toString(), '{ x: 100, y: 75 }', 'We expect the last segment point to be at the position where we wanted to draw the arc to.');
});

test('path.arcTo(from, through, to); where from, through and to all share the same y position and through lies to the right of to', function() {
	var path = new Path();
	path.strokeColor = 'black';

	path.add([40, 75]);
	path.arcTo([150, 75], [100, 75]);
	equals(path.lastSegment.point.toString(), '{ x: 100, y: 75 }', 'We expect the last segment point to be at the position where we wanted to draw the arc to.');
});

test('path.arcTo(from, through, to); where from, through and to all share the same y position and through lies to the left of to', function() {
	var path = new Path();
	path.strokeColor = 'black';

	path.add([40, 75]);
	path.arcTo([10, 75], [100, 75]);
	equals(path.lastSegment.point.toString(), '{ x: 100, y: 75 }', 'We expect the last segment point to be at the position where we wanted to draw the arc to.');
});
@@ -1461,32 +1461,59 @@
 .add(%5B40, 75%5D);%0A
+%09var error = null;%0A%09try %7B%0A%09
 %09path.arcTo(%5B150
@@ -1536,162 +1536,116 @@
 );%0A%09
-equals(path.lastSegment.point.toString(), '%7B x: 100, y: 75 %7D', 'We expect the last segment point to be at the position where we wanted to draw the arc to.
+%7D catch (e) %7B%0A%09%09error = e;%0A%09%7D%0A%09equals(error != null, true, 'We expect this arcTo() command to throw an error
 ');%0A
@@ -1860,32 +1860,59 @@
 .add(%5B40, 75%5D);%0A
+%09var error = null;%0A%09try %7B%0A%09
 %09path.arcTo(%5B10,
@@ -1934,162 +1934,116 @@
 );%0A%09
-equals(path.lastSegment.point.toString(), '%7B x: 100, y: 75 %7D', 'We expect the last segment point to be at the position where we wanted to draw the arc to.
+%7D catch (e) %7B%0A%09%09error = e;%0A%09%7D%0A%09equals(error != null, true, 'We expect this arcTo() command to throw an error
 ');%0A

Fix tests for #arcTo() commands that are supposed to throw an error.