File: test_svg_surface.rb

package info (click to toggle)
ruby-cairo 1.17.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,532 kB
  • sloc: ruby: 11,997; ansic: 10,183; sh: 48; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 598 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class SVGSurfaceTest < Test::Unit::TestCase
  include Helper

  def test_new_with_nil_target
    surface = Cairo::SVGSurface.new(nil, 10, 20)
    surface.finish
  end

  def test_unit
    only_cairo_version(1, 15, 10)
    output = StringIO.new
    surface = Cairo::SVGSurface.new(output, 10, 20)
    if Cairo.satisfied_version?(1, 17, 6)
      assert_equal(Cairo::SVGUnit::USER, surface.document_unit)
    else
      assert_equal(Cairo::SVGUnit::PT, surface.document_unit)
    end
    surface.document_unit = Cairo::SVGUnit::CM
    assert_equal(Cairo::SVGUnit::CM, surface.document_unit)
  end
end