Sha256: 591951764e02de5ad19a613686dc783dcc90261ef161e29eb1089c6982d94c46

Contents?: true

Size: 635 Bytes

Versions: 3

Compression:

Stored size: 635 Bytes

Contents

module Museo
  module MinitestIntegration
    include TestIntegration

    def self.included(base)
      base.extend(ClassMethods)
    end

    module ClassMethods
      def snapshot(description)
        test "snapshot: #{description}" do
          begin
            _museo_setup

            instance_eval(&Proc.new)

            assert_snapshot
          ensure
            _museo_teardown
          end
        end
      end
    end

    def assert_snapshot
      assert_equal(
        Snapshot::Minitest.new(self).body,
        Snapshot.sanitize_response(response.body),
        "Snapshot did not match",
      )
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
museo-0.3.0 lib/museo/minitest_integration.rb
museo-0.2.0 lib/museo/minitest_integration.rb
museo-0.1.0 lib/museo/minitest_integration.rb