class XMLSurfaceTest < Test::Unit::TestCase include Helper def setup only_surface("XML") end def test_new only_cairo_version(1, 12, 0) output = StringIO.new device = Cairo::XMLDevice.new(output) surface = Cairo::XMLSurface.new(device, 100, 200) Cairo::Context.create(surface) do |context| context.move_to(15, 30) context.line_to(80, 100) context.stroke end assert_equal(<<-EOX, output.string) OVER 2 10 LINE_CAP_BUTT LINE_JOIN_MITER 0 0 0 1 15 30 m 80 100 l 0.1 DEFAULT EOX end end