Sha256: d2a8769ae6f868a2c94e5c43a31f280e32c3be651e0e1d8b61305fbb05dbf0f3

Contents?: true

Size: 1.04 KB

Versions: 25

Compression:

Stored size: 1.04 KB

Contents

require "cairo"
require "poppler"
require "stringio"

module Helper
  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_windows
    omit("Only for Windows platform") unless windows?
  end

  def only_not_windows
    omit("Only for not Windows platform") if windows?
  end

  def windows?
    /cygwin|mingw|mswin|bccwin/ === RUBY_PLATFORM
  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

  def fixture_path(*components)
    File.join(__dir__, "fixture", *components)
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

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