Skip to content

Commit 676aa94

Browse files
pftgclaude
andcommitted
refactor: merge build_null_comparison into build_null_difference
Two methods that always composed together — build_null_comparison created a frozen Comparison, build_null_difference wrapped it in a Difference. Merged into single build_null_difference method. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9478f7f commit 676aa94

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

lib/capybara/screenshot/diff/image_compare.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,9 @@ def load_comparison(base_path, new_path, options)
168168
image_preprocessor.process_comparison(comparison)
169169
end
170170

171-
def build_null_difference(failed_by = nil, comparison = nil)
172-
Difference.build_null(comparison || build_null_comparison, base_image_path, image_path, failed_by)
173-
end
174-
175-
def build_null_comparison
176-
Comparison.new(nil, nil, driver_options, driver, image_path, base_image_path).freeze
171+
def build_null_difference(failed_by = nil)
172+
comparison = Comparison.new(nil, nil, driver_options, driver, image_path, base_image_path).freeze
173+
Difference.build_null(comparison, base_image_path, image_path, failed_by)
177174
end
178175

179176
# Check if both images exist

0 commit comments

Comments
 (0)