Sha256: 87cb2459048cc8a6ec0154d9062a6f109ea1390490fdd0a30f969b510d754718

Contents?: true

Size: 835 Bytes

Versions: 23

Compression:

Stored size: 835 Bytes

Contents

class TeeSurfaceTest < Test::Unit::TestCase
  include Helper

  def setup
    only_surface("Tee")
    only_surface("Script")
  end

  def test_new
    output1 = StringIO.new
    device1 = Cairo::ScriptDevice.new(output1)
    surface1 = Cairo::ScriptSurface.new(device1, 100, 200)
    output2 = StringIO.new
    device2 = Cairo::ScriptDevice.new(output2)
    surface2 = Cairo::ScriptSurface.new(device2, 100, 200)

    surface = Cairo::TeeSurface.new(surface1)
    surface << surface2
    Cairo::Context.create(surface) do |context|
      context.move_to(15, 30)
      context.line_to(80, 100)
      context.stroke
    end
    assert_equal(<<-EOS, output1.string)
%!CairoScript
<< /content //COLOR_ALPHA /width 100 /height 200 >> surface context
n 15 30 m 80 100 l
stroke+
EOS
    assert_equal(output1.string, output2.string)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
cairo-1.17.12 test/test_tee_surface.rb
cairo-1.17.11 test/test_tee_surface.rb
cairo-1.17.10 test/test_tee_surface.rb
cairo-1.17.9 test/test_tee_surface.rb
cairo-1.17.8 test/test_tee_surface.rb
cairo-1.17.7 test/test_tee_surface.rb
cairo-1.17.6 test/test_tee_surface.rb
cairo-1.17.5 test/test_tee_surface.rb
cairo-1.17.4 test/test_tee_surface.rb
cairo-1.16.6 test/test_tee_surface.rb
cairo-1.16.5 test/test_tee_surface.rb
cairo-1.16.4 test/test_tee_surface.rb
cairo-1.16.3 test/test_tee_surface.rb
cairo-1.16.2 test/test_tee_surface.rb
cairo-1.16.1-x86-mingw32 test/test_tee_surface.rb
cairo-1.16.1-x64-mingw32 test/test_tee_surface.rb
cairo-1.16.1 test/test_tee_surface.rb
cairo-1.16.0-x86-mingw32 test/test_tee_surface.rb
cairo-1.16.0-x64-mingw32 test/test_tee_surface.rb
cairo-1.16.0 test/test_tee_surface.rb