Sha256: 61a52581ac24f535928770479ec7d474c13cb48572ecd70ff6415401b0b2e346

Contents?: true

Size: 712 Bytes

Versions: 3

Compression:

Stored size: 712 Bytes

Contents

# frozen_string_literal: true

module Capybara
  module Screenshot
    module Diff
      module Utils
        def self.detect_available_drivers
          result = []
          begin
            result << :vips if defined?(Vips) || require("vips")
          rescue LoadError
            # vips not present
          end
          begin
            result << :chunky_png if defined?(ChunkyPNG) || require("chunky_png")
          rescue LoadError
            # chunky_png not present
          end
          result
        end

        def self.detect_test_framework_assert
          require "minitest"
          ::Minitest::Assertion
        rescue
          ::RuntimeError
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capybara-screenshot-diff-1.7.1 lib/capybara/screenshot/diff/drivers/utils.rb
capybara-screenshot-diff-1.7.0 lib/capybara/screenshot/diff/drivers/utils.rb
capybara-screenshot-diff-1.6.3 lib/capybara/screenshot/diff/drivers/utils.rb