lib/capybara/screenshot/diff/difference.rb in capybara-screenshot-diff-1.8.3 vs lib/capybara/screenshot/diff/difference.rb in capybara-screenshot-diff-1.9.0
- old
+ new
@@ -3,16 +3,20 @@
require "json"
module Capybara
module Screenshot
module Diff
- class Difference < Struct.new(:region, :meta, :comparison)
+ class Difference < Struct.new(:region, :meta, :comparison, :failed_by)
def different?
- !(blank? || tolerable?)
+ failed? || !(blank? || tolerable?)
end
- def base_image
- comparison.base_image
+ def equal?
+ !different?
+ end
+
+ def failed?
+ !!failed_by
end
def options
comparison.options
end