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
savant-echo-1.0.4 bin/packaging/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-1.0.4 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-1.0.1 bin/packaging/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-1.0.1 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.91 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.91 bin/packaging/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.9 bin/packaging/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.9 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.6 bin/packaging/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.6 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.5 bin/packaging/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.5 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.4 bin/packaging/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.4 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.3 bin/packaging/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
savant-echo-0.1.3 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/cairo-1.15.2/test/cairo-test-utils.rb
cairo-1.15.3-x86-mingw32 test/cairo-test-utils.rb
cairo-1.15.3-x64-mingw32 test/cairo-test-utils.rb
cairo-1.15.3 test/cairo-test-utils.rb
cairo-1.14.6 test/cairo-test-utils.rb