Module: Minitest

Defined in:
lib/minitest/snapshot_inspector_plugin.rb

Defined Under Namespace

Classes: SnapshotInspectorReporter

Class Method Summary collapse

Class Method Details

.plugin_snapshot_inspector_init(_options) ⇒ Object



21
22
23
24
25
26
# File 'lib/minitest/snapshot_inspector_plugin.rb', line 21

def plugin_snapshot_inspector_init(_options)
  return unless SnapshotInspector.configuration.snapshot_taking_enabled

  reporter << SnapshotInspectorReporter.new
  SnapshotInspector::Storage.clear(:processing)
end

.plugin_snapshot_inspector_options(opts, _options) ⇒ Object



15
16
17
18
19
# File 'lib/minitest/snapshot_inspector_plugin.rb', line 15

def plugin_snapshot_inspector_options(opts, _options)
  opts.on "--take-snapshots", "Take snapshots of responses for inspecting at #{SnapshotInspector.configuration.host + SnapshotInspector.configuration.route_path}" do
    SnapshotInspector.configuration.snapshot_taking_enabled = true
  end
end