Sha256: db781fae8892e7380525d353eb77016cda4468abff7b0436e690f1735e9b3d60

Contents?: true

Size: 690 Bytes

Versions: 2

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

require 'rspec/snapshot/matchers/match_snapshot'
require 'rspec/snapshot/file_operator'
require 'rspec/snapshot/serializer_factory'

module RSpec
  module Snapshot
    # rubocop:disable Style/Documentation
    module Matchers
      def match_snapshot(snapshot_name, config = {})
        MatchSnapshot.new(SerializerFactory.new(config).create,
                          FileOperator.new(snapshot_name,
                                           RSpec.current_example.metadata))
      end

      alias snapshot match_snapshot
    end
    # rubocop:enable Style/Documentation
  end
end

RSpec.configure do |config|
  config.include RSpec::Snapshot::Matchers
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspec-snapshot-2.0.3 lib/rspec/snapshot/matchers.rb
rspec-snapshot-2.0.2 lib/rspec/snapshot/matchers.rb