Sha256: 985367bc1af580da8a7d5bc086536454e112c46d0ef5b37306cc6e49b34c49cc

Contents?: true

Size: 924 Bytes

Versions: 37

Compression:

Stored size: 924 Bytes

Contents

require 'cairo'
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

37 entries across 29 versions & 2 rubygems

Version Path
cairo-1.14.6-x86-mingw32 test/cairo-test-utils.rb
cairo-1.14.6-x64-mingw32 test/cairo-test-utils.rb
cairo-1.15.2-x64-mingw32 test/cairo-test-utils.rb
cairo-1.15.2-x86-mingw32 test/cairo-test-utils.rb
cairo-1.15.2 test/cairo-test-utils.rb
cairo-1.14.3-x86-mingw32 test/cairo-test-utils.rb
cairo-1.14.3-x64-mingw32 test/cairo-test-utils.rb
cairo-1.14.3 test/cairo-test-utils.rb
cairo-1.14.2-x64-mingw32 test/cairo-test-utils.rb
cairo-1.14.2-x86-mingw32 test/cairo-test-utils.rb
cairo-1.14.2 test/cairo-test-utils.rb
cairo-1.14.1-x86-mingw32 test/cairo-test-utils.rb
cairo-1.14.1-x64-mingw32 test/cairo-test-utils.rb
cairo-1.14.1 test/cairo-test-utils.rb
cairo-1.14.0-x64-mingw32 test/cairo-test-utils.rb
cairo-1.14.0-x86-mingw32 test/cairo-test-utils.rb
cairo-1.14.0 test/cairo-test-utils.rb