Skip to content

Commit d3a7782

Browse files
committed
Add changelog
[ci skip]
1 parent 0e67387 commit d3a7782

File tree

2 files changed

+68
-14
lines changed

2 files changed

+68
-14
lines changed

CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Changelog
2+
3+
## 0.2.0 (Unreleased)
4+
5+
Lots of fixes and new features!
6+
7+
* Fix how objects are displayed in diff output:
8+
* Fix output of diffs so that objects are deeply pretty printed
9+
* Use Object#inspect as a fallback for single-line object inspection
10+
* Support diffing ordinary, "non-custom" objects
11+
(those that do *not* respond to `attributes_for_super_diff`)
12+
* Add custom coloring/messaging to `include` matcher
13+
* Support pretty-printing `a_hash_including` objects
14+
and diffing them with hashes
15+
* Support pretty-printing `a_collection_including` objects
16+
and diffing them with arrays
17+
* Add custom coloring/messaging to `have_attributes` matcher
18+
* Support pretty-printing `an_object_having_attributes` objects
19+
and diffing them with other objects
20+
* Add a key/legend to the diff output so it's less confusing
21+
* Add custom coloring/messaging to `respond_to` matcher
22+
* Add custom coloring/messaging to `raise_error` matcher
23+
* Fix output from diff between a multi-line string with a single-line
24+
(and vice versa)
25+
* Make sure that RSpec double objects are pretty-printed correctly
26+
* Add custom coloring/messaging to `contain_exactly`
27+
* Support pretty-printing `a_collection_containing_exactly` objects
28+
and diffing them with other arrays
29+
* Add support for diffing ActiveRecord models
30+
* Add support for diffing ActiveRecord::Relation objects with arrays
31+
* Fix output for diff between two completely different kinds of objects
32+
* Support pretty-printing HashWithIndifferentAccess objects
33+
and diffing them with hashes
34+
* Detect and handle recursive data structures
35+
* Automatically disable color output when running tests non-interactively
36+
(e.g. on a CI service)
37+
38+
## [0.1.0 (2018-10-02)][v0.1.0]
39+
40+
[v0.1.0]: https://github.com/mcmire/super_diff/tree/v0.1.0
41+
42+
Initial version!
43+
44+
* Support diffing primitives
45+
* Support diffing strings (single-line and multi-line)
46+
* Support diffing arrays (simple and complex)
47+
* Support diffing "custom objects"
48+
(i.e. objects that respond to `attributes_for_super_diff`)
49+
* Add basic integration with RSpec

README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
[hound-badge]: https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg
88
[hound]: https://houndci.com
99

10-
SuperDiff is a tool that displays the differences between two data structures of
11-
any type in Ruby.
10+
SuperDiff is a Ruby gem that intelligently displays the differences between two
11+
data structures of any type.
12+
13+
📢 **[See what's changed in the latest version (0.1.0)][changelog].**
14+
15+
[changelog]: CHANGELOG.md
1216

1317
## Introduction
1418

@@ -17,8 +21,8 @@ capabilities. Sometimes, whenever you use a matcher such as `eq`, `match`,
1721
`include`, or `have_attributes`, you will get a diff of the two data structures
1822
you are trying to match against. This is really helpful for strings, but not so
1923
helpful for other, more "real world" kinds of values, such as arrays, hashes,
20-
and full-scale objects. The reason this doesn't work is because [RSpec will
21-
naively run your `expected` and `actual` values through Ruby's PrettyPrinter
24+
and full-scale objects. The reason this doesn't work is because [all RSpec does
25+
is run your `expected` and `actual` values through Ruby's PrettyPrinter
2226
library][rspec-differ-fail] and then perform a diff of these strings.
2327

2428
For instance, let's say you wanted to compare these two hashes:
@@ -77,9 +81,9 @@ You would get output that looks like:
7781

7882
Not great.
7983

80-
This library provides a sophisticated set of comparators that know how to
81-
intelligent compute the differences between two data structures and display them
82-
in a way that makes sense. Using the example above, you'd get this instead:
84+
This library provides a diff engine that knows how to figure out the differences
85+
between any two data structures and display them in a sensible way. Using the
86+
example above, you'd get this instead:
8387

8488
![After super_diff](doc/after_super_diff.png)
8589

@@ -131,9 +135,9 @@ your test helper file (either `rails_helper` or `spec_helper`):
131135

132136
``` ruby
133137
SuperDiff::RSpec.configure do |config|
134-
config.extra_differ_classes << YourDiffer
135-
config.extra_operational_sequencer_classes << YourOperationalSequencer
136-
config.extra_diff_formatter_classes << YourDiffFormatter
138+
config.add_extra_differ_class(YourDiffer)
139+
config.add_extra_operational_sequencer_class(YourOperationalSequencer)
140+
config.add_extra_diff_formatter_class(YourDiffFormatter)
137141
end
138142
```
139143

@@ -143,16 +147,17 @@ and diff formatter. Also explanations on what these are.)*
143147
## Contributing
144148

145149
If you encounter a bug or have an idea for how this could be better, feel free
146-
to create an issue.
150+
to [create an issue](https://github.com/mcmire/super_diff/issues).
147151

148152
If you'd like to submit a PR instead, here's how to get started. First, fork
149-
this repo and then run:
153+
this repo. Then, when you've cloned your fork, run:
150154

151155
```
152156
bundle install
153157
```
154158

155-
This will install dependencies. From here you can run all of the tests:
159+
This will install various dependencies. After this, you can run all of the
160+
tests:
156161

157162
```
158163
bundle exec rake
@@ -188,7 +193,7 @@ Thank you so much!
188193

189194
[original-version]: https://github.com/mcmire/super_diff/tree/old-master
190195
[diff-lcs]: https://github.com/halostatue/diff-lcs
191-
[pretty-printer]: https://github.com/ruby/ruby/tree/master/lib
196+
[pretty-printer]: https://github.com/ruby/ruby/tree/master/lib/prettyprint.rb
192197
[awesome-print]: https://github.com/awesome-print/awesome_print
193198
[inspection-tree]: https://github.com/mcmire/super_diff/blob/master/lib/super_diff/object_inspection/inspection_tree.rb
194199

0 commit comments

Comments
 (0)