Module: Chunk
Instance Method Summary collapse
Instance Method Details
#matches?(actual_file, expexcted_file, diff_file) ⇒ Boolean
6 7 8 9 10 11 12 13 14 |
# File 'lib/nilal/chunky.rb', line 6 def matches? actual_file,expexcted_file,diff_file images = [ ChunkyPNG::Image.from_file(actual_file), ChunkyPNG::Image.from_file(expexcted_file) ] return false unless images.first.height == images.last.height && images.first.width == images.last.width image_diff_count = compute_image_difference images.first,images.last,diff_file image_diff_count == 0 end |