Sha256: 2e565b6a9e4f2243254ab7e7aec83f58548c9c5059a0108339fca6013bf6d898

Contents?: true

Size: 840 Bytes

Versions: 93

Compression:

Stored size: 840 Bytes

Contents

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

  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.new(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

93 entries across 85 versions & 2 rubygems

Version Path
cairo-1.14.2 test/test_tee_surface.rb
cairo-1.14.1-x86-mingw32 test/test_tee_surface.rb
cairo-1.14.1-x64-mingw32 test/test_tee_surface.rb
cairo-1.14.1 test/test_tee_surface.rb
cairo-1.14.0-x64-mingw32 test/test_tee_surface.rb
cairo-1.14.0-x86-mingw32 test/test_tee_surface.rb
cairo-1.14.0 test/test_tee_surface.rb
cairo-1.12.9-x86-mingw32 test/test_tee_surface.rb
cairo-1.12.9 test/test_tee_surface.rb
cairo-1.12.8-x86-mingw32 test/test_tee_surface.rb
cairo-1.12.8 test/test_tee_surface.rb
cairo-1.12.7-x86-mingw32 test/test_tee_surface.rb
cairo-1.12.7 test/test_tee_surface.rb
cairo-1.12.6-x86-mingw32 test/test_tee_surface.rb
cairo-1.12.6 test/test_tee_surface.rb
cairo-1.12.5-x86-mingw32 test/test_tee_surface.rb
cairo-1.12.5 test/test_tee_surface.rb
cairo-1.12.4-x86-mingw32 test/test_tee_surface.rb
cairo-1.12.4 test/test_tee_surface.rb
cairo-1.12.3-x86-mingw32 test/test_tee_surface.rb