lib/capybara/screenshot/diff/screenshoter.rb in capybara-screenshot-diff-1.8.0 vs lib/capybara/screenshot/diff/screenshoter.rb in capybara-screenshot-diff-1.8.1

- old
+ new

@@ -116,13 +116,12 @@ start = Time.now loop do pending_image = BrowserHelpers.pending_image_to_load break unless pending_image - assert( - (Time.now - start) < timeout, - "Images not loaded after #{timeout}s: #{pending_image.inspect}" - ) + if (Time.now - start) >= timeout + raise Capybara::Screenshot::Diff::ASSERTION, "Images not loaded after #{timeout}s: #{pending_image.inspect}" + end sleep 0.025 end end