specdiff 0.2.0 → 0.3.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/Gemfile.lock +1 -1
- data/README.md +21 -4
- data/assets/webmock_json_with_specdiff.png +0 -0
- data/assets/webmock_text_with_specdiff.png +0 -0
- data/examples/rspec/.rspec +2 -0
- data/examples/rspec/Gemfile +10 -0
- data/examples/rspec/Gemfile.lock +52 -0
- data/examples/rspec/spec/example_spec.rb +678 -0
- data/examples/rspec/spec/spec_helper.rb +68 -0
- data/examples/webmock/Gemfile.lock +2 -2
- data/lib/specdiff/colorize.rb +5 -0
- data/lib/specdiff/diff.rb +3 -1
- data/lib/specdiff/differ/hashdiff.rb +101 -22
- data/lib/specdiff/differ/not_found.rb +1 -1
- data/lib/specdiff/differ/text.rb +21 -7
- data/lib/specdiff/hashprint.rb +154 -0
- data/lib/specdiff/inspect.rb +41 -0
- data/lib/specdiff/rspec.rb +33 -0
- data/lib/specdiff/version.rb +1 -1
- data/lib/specdiff/webmock.rb +41 -1
- data/lib/specdiff.rb +15 -1
- metadata +19 -10
- data/lib/specdiff/webmock/request_body_diff.rb +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68cf98631e494fb5f016c0b3632cce58f616dad54ba11c782b37e3de4f2b36c9
|
4
|
+
data.tar.gz: b97fee8a8e586b383a71bf0dcdcb32be7cf1c135356a90ec2ae7488fc2082071
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b374cadd1aa564cf8252c4b3d6c4ca2be952b147891cdbec9f0799383349bf5bcf61a1ef94979bc2b1f7dbe4d850e586d4c11f1271c74a14dc9be09cffc4e184
|
7
|
+
data.tar.gz: 8379b0c263ae20900ec31b63ea9600e3c15cef8fe9b597c1e1349a708c323d03ee8bfaa46d6f6eeb666e2af0ee751e7ef2cd47917e927eeceb48a7f076a1e126
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.3.0-rc1]
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
- Add rspec integration. `require "specdiff/rspec"` The rspec integration will cause rspec's differ to be replaced entirely with specdiff. It will also cause rspec's inspect (object formatter) to be replaced with Specdiff's inspect.
|
15
|
+
- Add `Specdiff.diff_inspect` method, which is a wrapper for `#inspect` with some extra logic to make diffs look better.
|
16
|
+
- Add `Specdiff.hashprint` method, which prints hashes/arrays recursively in a way that is friendly to a text differ.
|
17
|
+
|
18
|
+
### Changed
|
19
|
+
|
20
|
+
- Improve contrast for some elements of the text differ
|
21
|
+
- Improve hash diffing. Introduce heuristic that decides whether a text diff of the hashes or the hashdiff gem's output is better for the situation.
|
22
|
+
- No longer produces a text diff of booleans
|
23
|
+
- No longer produces a text diff if both strings are a single line. (This would be useless since the diff is line-based.)
|
24
|
+
|
10
25
|
## [0.2.0] - 2023-12-04
|
11
26
|
|
12
27
|
### Changed
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -11,7 +11,24 @@ dropping the content type requirement.
|
|
11
11
|
Specdiff automagically detects the types of provided data and prints a suitable
|
12
12
|
diff between them.
|
13
13
|
|
14
|
-
|
14
|
+
## Cool, what does it look like?
|
15
|
+
|
16
|
+
When specdiff is enabled, webmock will produce a generic text diff using
|
17
|
+
[`Diff::LCS`](https://github.com/halostatue/diff-lcs) (basically the same
|
18
|
+
diff as rspec uses):
|
19
|
+
|
20
|
+
![webmock_text_with_specdiff](./assets/webmock_text_with_specdiff.png)
|
21
|
+
|
22
|
+
It will also produce a json [hashdiff](https://github.com/liufengyun/hashdiff),
|
23
|
+
even if the request did not have the content type header:
|
24
|
+
|
25
|
+
![d](./assets/webmock_json_with_specdiff.png)
|
26
|
+
|
27
|
+
(The output of the json diff is experimental, feedback would be great!)
|
28
|
+
|
29
|
+
You might also check out the `examples/` directory to play with it:
|
30
|
+
|
31
|
+
`$ cd examples/webmock && bundle install`
|
15
32
|
|
16
33
|
## Installation
|
17
34
|
|
@@ -116,10 +133,10 @@ High level description of the heuristic specdiff implements
|
|
116
133
|
|
117
134
|
- [ ] unit tests are passing (`$ bundle exec rake test`)
|
118
135
|
- [ ] linter is happy (`$ bundle exec rake lint`)
|
119
|
-
- [ ]
|
120
|
-
- [ ] `$ bundle exec ruby text.rb` looks good
|
136
|
+
- [ ] `examples/` look good
|
121
137
|
- [ ] update the version number in `version.rb`
|
122
|
-
- [ ] make sure the `examples/` `Gemfile.lock` files are updated
|
138
|
+
- [ ] make sure the `examples/` `Gemfile.lock` files are updated (run bundle install)
|
139
|
+
- [ ] make sure `Gemfile.lock` is updated (run bundle install)
|
123
140
|
- [ ] move unreleased changes to the next version in the [changelog](./CHANGELOG.md)
|
124
141
|
- [ ] commit in the form "vX.X.X" and push
|
125
142
|
- [ ] make sure the pipeline is green
|
Binary file
|
Binary file
|
@@ -0,0 +1,52 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../..
|
3
|
+
specs:
|
4
|
+
specdiff (0.3.0.pre.rc1)
|
5
|
+
diff-lcs (~> 1.5)
|
6
|
+
hashdiff (~> 1.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
bigdecimal (3.1.7)
|
12
|
+
debug (1.9.1)
|
13
|
+
irb (~> 1.10)
|
14
|
+
reline (>= 0.3.8)
|
15
|
+
diff-lcs (1.5.1)
|
16
|
+
hashdiff (1.1.0)
|
17
|
+
io-console (0.7.2)
|
18
|
+
irb (1.12.0)
|
19
|
+
rdoc
|
20
|
+
reline (>= 0.4.2)
|
21
|
+
psych (5.1.2)
|
22
|
+
stringio
|
23
|
+
rdoc (6.6.2)
|
24
|
+
psych (>= 4.0.0)
|
25
|
+
reline (0.4.3)
|
26
|
+
io-console (~> 0.5)
|
27
|
+
rspec (3.13.0)
|
28
|
+
rspec-core (~> 3.13.0)
|
29
|
+
rspec-expectations (~> 3.13.0)
|
30
|
+
rspec-mocks (~> 3.13.0)
|
31
|
+
rspec-core (3.13.0)
|
32
|
+
rspec-support (~> 3.13.0)
|
33
|
+
rspec-expectations (3.13.0)
|
34
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
+
rspec-support (~> 3.13.0)
|
36
|
+
rspec-mocks (3.13.0)
|
37
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
+
rspec-support (~> 3.13.0)
|
39
|
+
rspec-support (3.13.1)
|
40
|
+
stringio (3.1.0)
|
41
|
+
|
42
|
+
PLATFORMS
|
43
|
+
x86_64-linux
|
44
|
+
|
45
|
+
DEPENDENCIES
|
46
|
+
bigdecimal
|
47
|
+
debug
|
48
|
+
rspec
|
49
|
+
specdiff!
|
50
|
+
|
51
|
+
BUNDLED WITH
|
52
|
+
2.3.5
|