lib/capybara_screenshot_diff.rb in capybara-screenshot-diff-1.9.0 vs lib/capybara_screenshot_diff.rb in capybara-screenshot-diff-1.9.2
- old
+ new
@@ -2,13 +2,13 @@
require "capybara/dsl"
require "capybara/screenshot/diff/version"
require "capybara/screenshot/diff/utils"
require "capybara/screenshot/diff/image_compare"
+require "capybara_screenshot_diff/snap_manager"
require "capybara/screenshot/diff/test_methods"
require "capybara/screenshot/diff/screenshoter"
-
require "capybara/screenshot/diff/reporters/default"
module CapybaraScreenshotDiff
class ExpectationNotMet < StandardError; end
end
@@ -18,11 +18,11 @@
mattr_accessor :add_driver_path
mattr_accessor :add_os_path
mattr_accessor :blur_active_element
mattr_accessor :enabled
mattr_accessor :hide_caret
- mattr_reader(:root) { (defined?(Rails.root) && Rails.root) || Pathname(".").expand_path }
+ mattr_reader(:root) { (defined?(Rails) && defined?(Rails.root) && Rails.root) || Pathname(".").expand_path }
mattr_accessor :stability_time_limit
mattr_accessor :window_size
mattr_accessor(:save_path) { "doc/screenshots" }
mattr_accessor(:use_lfs)
mattr_accessor(:screenshot_format) { "png" }
@@ -61,9 +61,10 @@
mattr_accessor :skip_area
mattr_accessor(:driver) { :auto }
mattr_accessor :tolerance
mattr_accessor(:screenshoter) { Screenshoter }
+ mattr_accessor(:manager) { CapybaraScreenshotDiff::SnapManager }
AVAILABLE_DRIVERS = Utils.detect_available_drivers.freeze
def self.default_options
{