Skip to content

Update changelog for recent InspectionTree change #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,45 @@

## 0.11.0 - 2024-02-10

### BREAKING CHANGES

- Change InspectionTree so that it no longer `instance_eval`s the block it
takes. ([#210](https://github.com/mcmire/super_diff/issues/210))
- If you have a custom InspectionTreeBuilder, you will need to change your
`call` method so that instead of looking like this:
```ruby
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:
```ruby
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
Expand All @@ -25,8 +64,6 @@

### Improvements

- Change InspectionTree so that it no longer `instance_eval`s the block it
takes. ([#210](https://github.com/mcmire/super_diff/issues/210))
- Improve wording in `raise_error` failure messages.
([#218](https://github.com/mcmire/super_diff/issues/218))

Expand Down