summaryrefslogtreecommitdiff
path: root/spec/shapes/path_spec.rb
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-04-08 15:16:08 -0600
committermo khan <mo@mokhan.ca>2015-04-08 15:16:08 -0600
commit208d393e2a282ceceee463e8d887bd2bfce4ce6e (patch)
tree234663d7f35a71997e793b2f6044773cd8450b7c /spec/shapes/path_spec.rb
parent63b7b31fe2136347e030dc4678c16b7d1f410a95 (diff)
add close path.
Diffstat (limited to 'spec/shapes/path_spec.rb')
-rw-r--r--spec/shapes/path_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/shapes/path_spec.rb b/spec/shapes/path_spec.rb
index 27c1aaf..646acfa 100644
--- a/spec/shapes/path_spec.rb
+++ b/spec/shapes/path_spec.rb
@@ -46,6 +46,19 @@ describe Scale::Path do
end
end
+ describe "#close_path" do
+ it 'navigates back to the start' do
+ subject.move_to(x: 10, y: 10)
+ subject.horizontal(10)
+ subject.close_path
+ expected = <<-XML
+<?xml version="1.0"?>
+<path d="M10 10 H 10 Z"/>
+ XML
+ expect(subject.to_xml).to eql(expected)
+ end
+ end
+
describe "drawing a rectangle" do
it 'draws the proper rectangle' do
subject.move_to(x: 10, y: 10)