Module: Capybara::Screenshot::Diff

Defined in:
lib/snap_diff/legacy_shims.rb,
lib/snap_diff/legacy_shims.rb

Defined Under Namespace

Modules: Reporters

Constant Summary collapse

LOADED_DRIVERS =

EAGER same-object aliases of canonical values (see header for why each one is eager rather than a warn-once const_missing shim). .registry, not .loaded: this alias is assigned at load time by the gem itself, and .loaded announces its own 2.1 removal. Same object either way -- which is the whole point of the alias.

SnapDiff::Drivers.registry
AVAILABLE_DRIVERS =
SnapDiff::Drivers::AVAILABLE_DRIVERS
Comparison =
SnapDiff::Comparison::Images
VERSION =
SnapDiff::VERSION

Class Method Summary collapse

Class Method Details

.compare(baseline_path, current_path, **options) ⇒ Object



297
298
299
# File 'lib/snap_diff/legacy_shims.rb', line 297

def self.compare(baseline_path, current_path, **options)
  SnapDiff.compare(baseline_path, current_path, **options)
end

.configureObject

Configure screenshot and diff settings in one block.

Capybara::Screenshot::Diff.configure do |screenshot, diff|
screenshot.window_size = [1280, 1024]
screenshot.stability_time_limit = 1
diff.driver = :vips
diff.tolerance = 0.0005
end

The bare yield (rather than an explicit &block) keeps this method's published arity byte-identical to what it always had.



293
294
295
# File 'lib/snap_diff/legacy_shims.rb', line 293

def self.configure
  SnapDiff.start { |screenshot, diff| yield screenshot, diff }
end

.default_optionsObject



301
302
303
304
# File 'lib/snap_diff/legacy_shims.rb', line 301

def self.default_options
  SnapDiff::Deprecation.notice
  SnapDiff.config.default_options
end