Sha256: c6de5395b897905018cf9079bc07f5666e96b61391eb862deb14fc9189672a81

Contents?: true

Size: 472 Bytes

Versions: 4

Compression:

Stored size: 472 Bytes

Contents

module Introspection
  module Assertions
    def assert_snapshot_changed(object)
      before = Snapshot.new(object)
      yield
      after = Snapshot.new(object)
      assert before.changed?(after), "Snapshot has not changed."
    end

    def assert_snapshot_unchanged(object)
      before = Snapshot.new(object)
      yield
      after = Snapshot.new(object)
      assert !before.changed?(after), "Snapshot has changed: #{before.diff(after).inspect}"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
introspection-0.0.4 lib/introspection/assertions.rb
introspection-0.0.3 lib/introspection/assertions.rb
introspection-0.0.2 lib/introspection/assertions.rb
introspection-0.0.1 lib/introspection/assertions.rb