Sha256: 1cda39bf70e8c21de433aad089cb47112330ed64d4c76cd451124a0e08b49138

Contents?: true

Size: 943 Bytes

Versions: 12

Compression:

Stored size: 943 Bytes

Contents

require 'cairo'
#require 'poppler'
require 'stringio'
require 'test/unit/notify'

module CairoTestUtils
  private
  def only_cairo_version(major, minor, micro=nil)
    unless Cairo.satisfied_version?(major, minor, micro)
      omit("Require cairo >= #{major}.#{minor}.#{micro}")
    end
  end

  def only_win32
    omit("Only for Win32 platform") unless win32
  end

  def win32?
    /cygwin|mingw|mswin32|bccwin32/.match(RUBY_PLATFORM) ? true : false
  end

  def quartz?
    Cairo::FontFace.quartz_supported?
  end

  def only_device(name)
    only_cairo_version(1, 10)

    unless Cairo::Device.supported?(name)
      omit("Only for #{name} device available")
    end
  end

  def only_surface(name)
    unless Cairo::Surface.supported?(name)
      omit("Only for #{name} device available")
    end
  end

  def only_pattern(name)
    unless Cairo::Pattern.supported?(name)
      omit("Only for #{name} device available")
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cairo-1.15.7-x64-mingw32 test/cairo-test-utils.rb
cairo-1.15.7-x86-mingw32 test/cairo-test-utils.rb
cairo-1.15.7 test/cairo-test-utils.rb
cairo-1.15.6-x86-mingw32 test/cairo-test-utils.rb
cairo-1.15.6-x64-mingw32 test/cairo-test-utils.rb
cairo-1.15.6 test/cairo-test-utils.rb
cairo-1.15.5-x64-mingw32 test/cairo-test-utils.rb
cairo-1.15.5-x86-mingw32 test/cairo-test-utils.rb
cairo-1.15.5 test/cairo-test-utils.rb
cairo-1.15.4-x86-mingw32 test/cairo-test-utils.rb
cairo-1.15.4-x64-mingw32 test/cairo-test-utils.rb
cairo-1.15.4 test/cairo-test-utils.rb