Sha256: c257f4f7d0ecf3107e1bb5b77ffd42c3d625607757e716d4615d7b00bc80b756

Contents?: true

Size: 797 Bytes

Versions: 2

Compression:

Stored size: 797 Bytes

Contents

class XMLSurfaceTest < Test::Unit::TestCase
  include CairoTestUtils

  def setup
    only_surface("XML")
  end

  def test_new
    output = StringIO.new
    device = Cairo::XMLDevice.new(output)
    surface = Cairo::XMLSurface.new(device, 100, 200)
    Cairo::Context.new(surface) do |context|
      context.move_to(15, 30)
      context.line_to(80, 100)
      context.stroke
    end
    assert_equal(<<-EOX, output.string)
<stroke>
  <operator>OVER</operator>
  <line-width>2</line-width>
  <miter-limit>10</miter-limit>
  <line-cap>LINE_CAP_BUTT</line-cap>
  <line-join>LINE_JOIN_MITER</line-join>
  <source-pattern>
    <solid>0 0 0 1</solid>
  </source-pattern>
  <path> 15 30 m 80 100 l  </path>  <tolerance>0.1</tolerance>
  <antialias>ANTIALIAS_DEFAULT</antialias>
</stroke>
EOX
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cairo-1.10.0-x86-mingw32 test/test_xml_surface.rb
cairo-1.10.0 test/test_xml_surface.rb