Skip to content

Releases: splitwise/super_diff

0.8.0

26 Apr 01:44

Choose a tag to compare

BREAKING CHANGES

  • Diff formatters are now gone in favor of operation tree flatteners. If you
    have a custom diff formatter, you will want to inherit from
    SuperDiff::OperationTreeFlatteners::Base (or an appropriate subclass).
    Additionally, the add_extra_diff_formatter_class configuration option has
    disappeared; instead, operation tree classes are expected to have an
    operation_tree_flattener_class method, which should return your custom
    operation tree flattener class. (#91)

Features

  • Add the ability to compress long diffs by eliding sections of unchanged data
    (data which is present in both "expected" and "actual" values). This
    functionality is not enabled by default; rather, you will need to activate it.
    At a minimum, you will want to add this to your spec helper (or a support file
    if you so desire):

    SuperDiff.configure do |config|
      config.diff_elision_enabled = true
    end

    By default the elision will be pretty aggressive, but if you want to preserve
    more of the unchanged lines in the diff, you can set diff_elision_maximum:

    SuperDiff.configure do |config|
      config.diff_elision_enabled = true
      config.diff_elision_maximum = 10
    end

    Here, the gem will try to keep at least 10 unchanged lines in between changed
    lines.

    (#91)

  • Update inspection of Doubles to include stubbed methods and their values.
    (#91)

Improvements

  • Change how objects are inspected on a single line so that instance variables
    are always sorted. (#91)
  • Make a tweak to how hashes are presented in diffs and inspections: a hash that
    has a mixture of symbols and strings will be presented as though all keys are
    strings (i.e. hashrocket syntax). (#91)

0.7.0

08 May 03:57

Choose a tag to compare

Features

  • Add support for hash_including, array_including, kind_of, and instance_of, which come from rspec-mocks. (#128)

  • Update how Time-like values are displayed in diffs to include subseconds so that it is easy to tell the difference between two times that are extremely close to each other. (#130)

Fixes

  • Fix comparison involving hashes to prevent a case where the same key would show up twice in the diff (one as a "deleted" version and another as an "unchanged" version). (#129)

0.6.2

08 May 03:57

Choose a tag to compare

Improvements

  • Rename SuperDiff::ObjectInspection.inspect to something less collision-y
    so that it can be inspected in IRB sessions. (#123)

  • Silence warnings. (#124)

0.6.1

13 Mar 02:20

Choose a tag to compare

Bug fixes

  • Fix compatibility issues with newer versions of rspec-rails which prevented the gem from being loaded. (#121)

0.6.0

07 Feb 23:04

Choose a tag to compare

Features

  • You can now customize the colors that SuperDiff uses by adding this to your test setup:

    SuperDiff.configure do |config|
      config.actual_color = :green
      config.expected_color = :red
      config.border_color = :yellow
      config.header_color = :yellow
    end

    (#107, 042e8ec)

  • Ruby 3.0 is now supported. (#118)

Bug fixes

  • Resolve compatibility issues with RSpec 3.10. (#114)
  • Fix diffs involving contain_exactly and a_collection_containing_exactly
    so that if there are extra items in the actual value,
    they are shown with +s. (#106)

Other notable changes

  • Fix reliability issues with CI.
  • Fix rake spec so that it works when run locally again.

0.5.3

21 Dec 17:10

Choose a tag to compare

Bug fixes

  • Fix match_array so that it works when given a string. (#110)

Improvements

  • Include the license in the gemspec so that it is visible via tools such as
    license_finder. (#111)

0.5.2

23 Nov 16:37

Choose a tag to compare

Bug fixes

  • Add missing standard library requires. (#98)

Other notable changes

  • Drop support for Ruby 2.4.

0.5.1

19 Jun 18:08

Choose a tag to compare

Bug fixes

  • Add dependency on attr_extras back as it was mistakenly removed in the
    previous release. (#92)

0.5.0

19 Jun 06:29

Choose a tag to compare

Breaking changes

  • Do some reorganizing and rename some concepts in the code: "operational
    sequencer" changes to "operation tree builder" and "operation sequence"
    changes to "operation tree". Although super_diff is not yet at 1.0, this does
    result in breaking changes to the API, so:

    • If you are inheriting from SuperDiff::OperationalSequencers::*, you will
      want to now inherit from SuperDiff::OperationTreeBuilders::*.

    • If you are inheriting from SuperDiff::OperationSequence::*, you will
      want to now inherit from SuperDiff::OperationTrees::*.

    • If you are configuring the gem by saying:

      SuperDiff::RSpec.configuration do |config|
        config.add_extra_operational_sequencer_class(SomeClass)
        config.add_extra_operation_sequence_class(SomeClass)
      end

      you will want to change this to:

      SuperDiff::RSpec.configuration do |config|
        config.add_extra_operation_tree_builder_class(SomeClass)
        config.add_extra_operation_tree_class(SomeClass)
      end

    (#84, #85)

Features

  • Add inspectors for an_instance_of, a_kind_of, and a_value_within.
    (#74)

Bug fixes

  • Get rid of warnings produced on Ruby 2.7.1. (#71)
  • Fix diff produced by (incorrect) usage of have_attributes with a hash as the
    actual value. (#76)

Improvements

  • Move configuration so that instead of using

    SuperDiff::RSpec.configure do |config|
      # ...
    end

    you can now say:

    SuperDiff.configure do |config|
      # ...
    end

    (#80)

  • Update diff between two hashes so that original ordering of keys is preserved.
    (#81)

0.4.2

12 Feb 05:49

Choose a tag to compare