From b75f98a31fea56dea6cdca679c4809838184b832 Mon Sep 17 00:00:00 2001 From: Konrad Date: Thu, 14 Nov 2024 17:01:09 +0100 Subject: [PATCH] feat: add a readable error in reference image matcher when input image does not exist --- spec/support/match_reference_image.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/support/match_reference_image.rb b/spec/support/match_reference_image.rb index 2dd6f26..c0f894a 100644 --- a/spec/support/match_reference_image.rb +++ b/spec/support/match_reference_image.rb @@ -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