Class: Matcher

Inherits:
Object
  • Object
show all
Defined in:
lib/image_comparable/matcher.rb

Instance Method Summary collapse

Instance Method Details

#compare_screens(baseline_path, screenshot_path, acceptant_criteria) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/image_comparable/matcher.rb', line 5

def compare_screens(baseline_path, screenshot_path, acceptant_criteria)
  baseline = ImageComparable::Image.new(baseline_path)
  screenshot = ImageComparable::Image.new(screenshot_path)

  raise 'cannot compare images with different sizes' unless
      baseline.size_match? screenshot

  ImageDiff.new(baseline, screenshot, acceptant_criteria).save
end