Skip to content

0.11.0

Compare
Choose a tag to compare
@mcmire mcmire released this 10 Feb 23:01
· 22 commits to main since this release
84c8a32

BREAKING CHANGES

  • Change InspectionTree so that it no longer instance_evals the block it takes. (#210)
    • If you have a custom InspectionTreeBuilder, you will need to change your call method so that instead of looking like this:
      def call
        SuperDiff::ObjectInspection::InspectionTree.new do
          as_lines_when_rendering_to_lines(collection_bookend: :open) do
            add_text object.inspect
          end
        end
      end
      it looks something like this instead:
      def call
        SuperDiff::ObjectInspection::InspectionTree.new do |t1|
          t1.as_lines_when_rendering_to_lines(collection_bookend: :open) do |t2|
            t2.add_text object.inspect
          end
        end
      end
      Note that the following methods yield a new InspectionTree, so the tree needs to be given a new name each time. It is conventional to use t1,
      t2, etc.:
      • as_lines_when_rendering_to_lines
      • as_prefix_when_rendering_to_lines
      • as_prelude_when_rendering_to_lines
      • as_single_line
      • nested
      • only_when
      • when_empty
      • when_non_empty
      • when_rendering_to_lines
      • when_rendering_to_string

Features

  • Add inspector for RSpec describable matchers not otherwise handled by an explicit inspector. (#203, #219)
  • Support diffing date-like objects, e.g. Date vs. Date or Date vs. DateTime. (#198)

Fixes

  • Add inspector for ActiveSupport::OrderedOptions. (#199)
    • This prevents the gem from raising an error when the expected value is a Rails response object, e.g. expect(response).to be_forbidden.
  • Include extra_failure_lines from RSpec metadata in failure output. (#208)
  • Fix match_array so that it truly accepts a non-array argument, to match RSpec behavior. (#213)
  • Fix raise_error so that it accepts an RSpec matcher argument. (#214)

Improvements

  • Improve wording in raise_error failure messages. (#218)

Contributors

This release features the following contributors:

Thank you!