Sha256: 9dd49a935a15a28d1ece65348dea5f00b8e7c7b6ec7076ac27966d1211c3788a

Contents?: true

Size: 405 Bytes

Versions: 4

Compression:

Stored size: 405 Bytes

Contents

require 'test/unit'

module AppearanceAssertion
  include Test::Unit::Assertions

  def assert_same_image(expected_image_path, image_object, delta: 0.01)
    path = File.expand_path(File.join(__dir__, expected_image_path))

    expected = Magick::Image.read(path).first
    _, error = expected.compare_channel(image_object, Magick::MeanSquaredErrorMetric)
    assert_in_delta(0.0, error, delta)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rmagick-4.1.0.rc2 test/appearance/appearance_assertion.rb
rmagick-4.1.0.rc1 test/appearance/appearance_assertion.rb
rmagick-4.0.0 test/appearance/appearance_assertion.rb
rmagick-3.2.0 test/appearance/appearance_assertion.rb