diff --git a/lib/capybara/screenshot/diff/test_methods.rb b/lib/capybara/screenshot/diff/test_methods.rb index 2e9d7db4..d1a7a849 100644 --- a/lib/capybara/screenshot/diff/test_methods.rb +++ b/lib/capybara/screenshot/diff/test_methods.rb @@ -125,7 +125,7 @@ def screenshot(name, skip_stack_frames: 0, **options) unless job if Screenshot::Diff.fail_if_new - raise_error(<<-ERROR.strip_heredoc, caller(2)) + _raise_error(<<-ERROR.strip_heredoc, caller(2)) No existing screenshot found for #{screenshot_full_name}! To stop seeing this error disable by `Capybara::Screenshot::Diff.fail_if_new=false` ERROR @@ -140,7 +140,7 @@ def screenshot(name, skip_stack_frames: 0, **options) schedule_match_job(job) else error_msg = assert_image_not_changed(*job) - raise_error(error_msg, caller(2)) if error_msg + _raise_error(error_msg, caller(2)) if error_msg end end @@ -168,7 +168,7 @@ def assert_image_not_changed(caller, name, comparison) private - def raise_error(error_msg, backtrace) + def _raise_error(error_msg, backtrace) raise CapybaraScreenshotDiff::ExpectationNotMet.new(error_msg).tap { _1.set_backtrace(backtrace) } end diff --git a/test/fixtures/app/doc/screenshots/macos/cuprite/index.png b/test/fixtures/app/doc/screenshots/macos/cuprite/index.png index 2c77ba1f..7d2b9eda 100644 Binary files a/test/fixtures/app/doc/screenshots/macos/cuprite/index.png and b/test/fixtures/app/doc/screenshots/macos/cuprite/index.png differ diff --git a/test/fixtures/files/rspec_spec.rb b/test/fixtures/files/rspec_spec.rb index 4c89e7bb..12b1e788 100644 --- a/test/fixtures/files/rspec_spec.rb +++ b/test/fixtures/files/rspec_spec.rb @@ -36,4 +36,8 @@ expect(page).to match_screenshot("index", skip_stack_frames: 1, driver: :chunky_png) end + + it "does not conflicts with rspec methods" do + expect { raise StandardError }.to raise_error(StandardError) + end end