From 630c566717216443c6759577b23d67b9a7884f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 16 Jun 2011 23:58:28 +0100 Subject: [PATCH] Fix tests for #arcTo() commands that are supposed to throw an error. --- test/tests/Path_Drawing_Commands.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test/tests/Path_Drawing_Commands.js b/test/tests/Path_Drawing_Commands.js index 060b0b59..e42aa279 100644 --- a/test/tests/Path_Drawing_Commands.js +++ b/test/tests/Path_Drawing_Commands.js @@ -29,8 +29,13 @@ test('path.arcTo(from, through, to); where from, through and to all share the sa 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.'); + var error = null; + try { + path.arcTo([150, 75], [100, 75]); + } catch (e) { + error = e; + } + equals(error != null, true, 'We expect this arcTo() command to throw an error'); }); 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() { @@ -38,6 +43,11 @@ test('path.arcTo(from, through, to); where from, through and to all share the sa 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.'); + var error = null; + try { + path.arcTo([10, 75], [100, 75]); + } catch (e) { + error = e; + } + equals(error != null, true, 'We expect this arcTo() command to throw an error'); }); \ No newline at end of file