lib/capybara/screenshot/diff/image_compare.rb in capybara-screenshot-diff-0.8.0 vs lib/capybara/screenshot/diff/image_compare.rb in capybara-screenshot-diff-0.8.1
- old
+ new
@@ -7,16 +7,16 @@
include ChunkyPNG::Color
attr_reader :annotated_new_file_name, :annotated_old_file_name, :new_file_name,
:old_file_name
- def initialize(new_file_name, dimensions: nil, color_distance_limit: nil,
+ def initialize(new_file_name, old_file_name = nil, dimensions: nil, color_distance_limit: nil,
area_size_limit: nil)
@new_file_name = new_file_name
@color_distance_limit = color_distance_limit
@area_size_limit = area_size_limit
@dimensions = dimensions
- @old_file_name = "#{new_file_name}~"
+ @old_file_name = old_file_name || "#{new_file_name}~"
@annotated_old_file_name = "#{new_file_name.chomp('.png')}_0.png~"
@annotated_new_file_name = "#{new_file_name.chomp('.png')}_1.png~"
reset
end