require 'spec_helper' describe Polyline do describe "#to_svg" do it "should output an SVG document as a string" do line = Line.new(Vertex.new(0.0, 0.0, 0.0), Vertex.new(1.0, 1.0, 1.0)) polyline = Polyline.new([line]) expected_svg = '' + "\n" expected_svg += '' + "\n" expected_svg += '' + "\n" expected_svg += ' ' + "\n" expected_svg += " #{line.to_svg_path(:inches)}\n" expected_svg += ' ' + "\n" expected_svg += '' polyline.to_svg(20, 30, :inches, 1, 2).should == expected_svg end end end