Module: CapybaraScreenshotDiff

Extended by:
Forwardable
Defined in:
lib/capybara_screenshot_diff/dsl.rb,
lib/snap_diff/legacy_shims.rb,
lib/capybara_screenshot_diff/static.rb,
lib/capybara_screenshot_diff/minitest.rb,
lib/capybara_screenshot_diff/screenshot_assertion.rb

Overview

Since ADR-008 step 6 every method here is a thin forwarder; the canonical homes are SnapDiff (session lifecycle: per-test, SnapDiff.session and friends) and SnapDiff::Reporting (reporter lifecycle: process-global, suite-long). Names, arities and object identities are unchanged -- this module stays as the compatibility surface for existing consumers.

Defined Under Namespace

Modules: Minitest, Reporters

Constant Summary collapse

CapybaraScreenshotDiffError =

EAGER same-object aliases (see header): rescue-by-old-name and defined?/const_defined? feature detection must behave as they always have, under canonical and legacy requires alike.

SnapDiff::Error
ExpectationNotMet =
SnapDiff::ExpectationNotMet
UnstableImage =
SnapDiff::UnstableImage
WindowSizeMismatchError =
SnapDiff::WindowSizeMismatchError
DSL =
SnapDiff::DSL

Class Method Summary collapse

Class Method Details

.finalize_reporters!Object



49
50
51
# File 'lib/capybara_screenshot_diff/screenshot_assertion.rb', line 49

def finalize_reporters!
  SnapDiff::Reporting.finalize!
end

.pending_screenshots_messageObject



35
36
37
# File 'lib/capybara_screenshot_diff/screenshot_assertion.rb', line 35

def pending_screenshots_message
  SnapDiff.pending_screenshots_message
end

.registryObject

--- Session lifecycle (per-test) -> SnapDiff ---



21
22
23
# File 'lib/capybara_screenshot_diff/screenshot_assertion.rb', line 21

def registry
  SnapDiff.session
end

.reportersObject

--- Reporter lifecycle (process-global, suite-long) -> SnapDiff::Reporting ---



41
42
43
# File 'lib/capybara_screenshot_diff/screenshot_assertion.rb', line 41

def reporters
  SnapDiff::Reporting.reporters
end

.reporters_mutexObject



45
46
47
# File 'lib/capybara_screenshot_diff/screenshot_assertion.rb', line 45

def reporters_mutex
  SnapDiff::Reporting.mutex
end

.resetObject

Written out rather than def_delegators so the arities stay 0 (a Forwardable-generated method takes *args, **kwargs, &block).



31
32
33
# File 'lib/capybara_screenshot_diff/screenshot_assertion.rb', line 31

def reset
  SnapDiff.reset
end

.serveObject



10
11
12
# File 'lib/capybara_screenshot_diff/static.rb', line 10

def self.serve(...)
  SnapDiff.serve(...)
end