Skip to content

Commit 4a65fd8

Browse files
twill-hq[bot]Twill
andauthored
Pin minitest to < 6 to fix missing minitest/mock (#154)
* Pin minitest to < 6 to fix missing minitest/mock Minitest 6.0 moved mock.rb to a separate minitest-mock gem, breaking `require "minitest/mock"` in tests. Pin to < 6 to retain the built-in mock support. * Fix indentation in chunky_png_driver.rb to pass Standard Ruby linter --------- Co-authored-by: Twill <agent@twill.ai>
1 parent 62419f7 commit 4a65fd8

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

gems.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
group :test do
1616
gem "capybara", ">= 3.26"
1717
gem "mutex_m" # Needed for RubyMine debugging. Try removing it.
18-
gem "minitest", require: false
18+
gem "minitest", "< 6", require: false
1919
gem "minitest-stub-const", require: false
2020
gem "simplecov", require: false
2121
gem "rspec", require: false

lib/capybara/screenshot/diff/drivers/chunky_png_driver.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ def shift_distance_at(new_img, old_img, x, y, color_distance_limit:)
254254
if (x - shift_distance) >= 0 # left
255255
([0, top_row + 1].max..[y + shift_distance, new_img.height - 2].min)
256256
.each do |dy|
257-
if color_matches(new_img, org_color, x - shift_distance, dy, color_distance_limit)
258-
return shift_distance
257+
if color_matches(new_img, org_color, x - shift_distance, dy, color_distance_limit)
258+
return shift_distance
259+
end
259260
end
260-
end
261261
else
262262
bounds_breached += 1
263263
end
@@ -273,10 +273,10 @@ def shift_distance_at(new_img, old_img, x, y, color_distance_limit:)
273273
if (x + shift_distance) < new_img.width # right
274274
([0, top_row + 1].max..[y + shift_distance, new_img.height - 2].min)
275275
.each do |dy|
276-
if color_matches(new_img, org_color, x + shift_distance, dy, color_distance_limit)
277-
return shift_distance
276+
if color_matches(new_img, org_color, x + shift_distance, dy, color_distance_limit)
277+
return shift_distance
278+
end
278279
end
279-
end
280280
else
281281
bounds_breached += 1
282282
end

0 commit comments

Comments
 (0)