Skip to content

Commit

Permalink
feat: add a readable error in reference image matcher when input imag…
Browse files Browse the repository at this point in the history
…e does not exist
  • Loading branch information
knarewski committed Nov 14, 2024
1 parent b0b23c9 commit b75f98a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/support/match_reference_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def debug_data
end

match do |tested_path|
if File.file?(tested_path) && !File.file?(reference_path)
raise ArgumentError, "Provided path is not a file: #{tested_path}" unless File.file?(tested_path)

unless File.file?(reference_path)
debug_data.expose_from(tested_path: tested_path, file_type: file_type)
return false
end
Expand Down

0 comments on commit b75f98a

Please sign in to comment.