Sha256: 6f85d22615faea166d8cac31dbd169b15989a6391d79b189526e8b1c1c483ac0

Contents?: true

Size: 774 Bytes

Versions: 10

Compression:

Stored size: 774 Bytes

Contents

require 'cairo'
require 'stringio'

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 only_device(name)
    device_class = "#{name}Device"
    unless Cairo.const_defined?(device_class)
      omit("Only for #{device_class} device available")
    end
  end

  def only_surface(name)
    surface_class = "#{name}Surface"
    unless Cairo.const_defined?(surface_class)
      omit("Only for #{surface_class} surface available")
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cairo-1.12.1-x86-mingw32 test/cairo-test-utils.rb
cairo-1.12.1 test/cairo-test-utils.rb
cairo-1.12.0-x86-mingw32 test/cairo-test-utils.rb
cairo-1.12.0 test/cairo-test-utils.rb
cairo-1.10.2-x86-mingw32 test/cairo-test-utils.rb
cairo-1.10.2 test/cairo-test-utils.rb
cairo-1.10.1-x86-mingw32 test/cairo-test-utils.rb
cairo-1.10.1 test/cairo-test-utils.rb
cairo-1.10.0-x86-mingw32 test/cairo-test-utils.rb
cairo-1.10.0 test/cairo-test-utils.rb