Module: SnapshotTesting::RSpec

Extended by:
RSpec::Matchers::DSL
Defined in:
lib/snapshot_testing/rspec.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/snapshot_testing/rspec.rb', line 7

def self.included(base)
  base.let :__snapshot_recorder__ do |example|
    SnapshotTesting::Recorder.new(
      name: example.description,
      path: example.[:absolute_file_path]
    )
  end

  base.after :each do
    __snapshot_recorder__.commit
  end
end