lib/capybara/screenshot/diff/test_methods.rb in capybara-screenshot-diff-1.9.0 vs lib/capybara/screenshot/diff/test_methods.rb in capybara-screenshot-diff-1.9.2
- old
+ new
@@ -24,11 +24,11 @@
module Capybara
module Screenshot
module Diff
module TestMethods
# @!attribute [rw] test_screenshots
- # @return [Array(Array(Array(String), String, ImageCompare))] An array where each element is an array containing the caller context,
+ # @return [Array(Array(Array(String), String, ImageCompare | Minitest::Mock))] An array where each element is an array containing the caller context,
# the name of the screenshot, and the comparison object. This attribute stores information about each screenshot
# scheduled for comparison to ensure they do not show any unintended differences.
def initialize(*)
super
@screenshot_counter = nil
@@ -144,11 +144,11 @@
end
end
# Asserts that an image has not changed compared to its baseline.
#
- # @param caller [Array] The caller context, used for error reporting.
+ # @param caller [Array(String)] The caller context, used for error reporting.
# @param name [String] The name of the screenshot being verified.
# @param comparison [Object] The comparison object containing the result and details of the comparison.
# @return [String, nil] Returns an error message if the screenshot differs from the baseline, otherwise nil.
# @note This method is used internally to verify individual screenshots.
def assert_image_not_changed(caller, name, comparison)
@@ -161,10 +161,10 @@
FileUtils.rm_rf(comparison.base_image_path)
end
return unless result
- "Screenshot does not match for '#{name}' #{comparison.error_message}\n#{caller}"
+ "Screenshot does not match for '#{name}' #{comparison.error_message}\n#{caller.join(", ")}"
end
private
def raise_error(error_msg, backtrace)