Sha256: b4dfc1c7386d997b18eada75b1c22a0d04991403211d99980eb16333fbf03b55

Contents?: true

Size: 604 Bytes

Versions: 1

Compression:

Stored size: 604 Bytes

Contents

module Gatling
  class Comparison

    attr_accessor :match, :diff_image

    def initialize(actual_image, expected_image)
      compare(actual_image, expected_image)
    end

    def compare(actual_image, expected_image)
      diff_metric = actual_image.image.compare_channel(expected_image.image, Magick::MeanAbsoluteErrorMetric)
      @match = diff_metric[1] == 0.0
      unless @match
        diff_image = diff_metric.first
        @diff_image = Gatling::Image.new(:from_diff, actual_image.file_name, diff_image)
      end
      @match
    end

    def diff_image
      @diff_image
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gatling-1.0.7 lib/gatling/comparison.rb