minitest-difftastic 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +4 -4
- data/README.md +19 -3
- data/lib/minitest/difftastic/version.rb +1 -1
- data/lib/minitest/difftastic_plugin.rb +14 -3
- data/screenshots/integers.png +0 -0
- data/screenshots/nested_objects.png +0 -0
- data/screenshots/objects.png +0 -0
- data/screenshots/strings.png +0 -0
- metadata +12 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64691f1a85d150dae7c9c7894282b4443d089f4c7538c407073d48af5dc15f1c
|
4
|
+
data.tar.gz: 0f8f076b354274432deae363a4e6b892b788a07f92a7523c445efa79a3b9e9a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff9ba0933ff4f965554e2adf8195c2768388425301dcc4b8e53ee070d62aea9cb88ed0e120e0f05c9c8ae8e642ed3561f4cd4b942682712a9aca910ec308b8ee
|
7
|
+
data.tar.gz: 3b7e5c719343600c1c3aff4c071793e9d5087b53b78d642371adb84c1c4a5d12a5968645f5079fbc0270da42fa58b1f06a6b3c721c712664ceda1dd44ab9a957
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
minitest-difftastic (0.1.
|
5
|
-
difftastic (~> 0.
|
4
|
+
minitest-difftastic (0.1.2)
|
5
|
+
difftastic (~> 0.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
ast (2.4.2)
|
11
11
|
base64 (0.1.1)
|
12
|
-
difftastic (0.0
|
13
|
-
difftastic (0.0
|
12
|
+
difftastic (0.2.0-arm64-darwin)
|
13
|
+
difftastic (0.2.0-x86_64-linux)
|
14
14
|
json (2.6.3)
|
15
15
|
language_server-protocol (3.17.0.3)
|
16
16
|
minitest (5.25.4)
|
data/README.md
CHANGED
@@ -1,15 +1,31 @@
|
|
1
1
|
# Minitest::Difftastic
|
2
2
|
|
3
|
-
A Minitest Plugin which uses [`difftastic`](https://github.com/Wilfred/difftastic) (via [`difftastic-ruby`](https://github.com/joeldrapper/difftastic-ruby)) to show the diffs for failing assertions.
|
3
|
+
A Minitest Plugin which uses [`difftastic`](https://github.com/Wilfred/difftastic) (via [`difftastic-ruby`](https://github.com/joeldrapper/difftastic-ruby)) to show the diffs for failing assertions.
|
4
4
|
|
5
5
|
Also works for Rails tests using `ActiveSupport::TestCase`.
|
6
6
|
|
7
|
+
### Integers
|
8
|
+
|
9
|
+
![Integers Comparison](./screenshots/integers.png)
|
10
|
+
|
11
|
+
### Strings
|
12
|
+
|
13
|
+
![Strings Comparison](./screenshots/strings.png)
|
14
|
+
|
15
|
+
### Objects
|
16
|
+
|
17
|
+
![Objects Comparison](./screenshots/objects.png)
|
18
|
+
|
19
|
+
### Nested Objects
|
20
|
+
|
21
|
+
![Nested Objects Comparison](./screenshots/nested_objects.png)
|
22
|
+
|
7
23
|
## Installation
|
8
24
|
|
9
|
-
Install the gem and add to the application's Gemfile by executing:
|
25
|
+
Install the gem and add to the application's Gemfile `test` group by executing:
|
10
26
|
|
11
27
|
```shell
|
12
|
-
bundle add minitest-difftastic
|
28
|
+
bundle add minitest-difftastic --group=test
|
13
29
|
```
|
14
30
|
|
15
31
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
@@ -5,10 +5,21 @@ require "difftastic"
|
|
5
5
|
# TODO: use refinements
|
6
6
|
module Minitest
|
7
7
|
module Assertions
|
8
|
+
DIFFER = ::Difftastic::Differ.new(
|
9
|
+
color: :always,
|
10
|
+
tab_width: 2,
|
11
|
+
syntax_highlight: :off,
|
12
|
+
left_label: "Expected",
|
13
|
+
right_label: "Actual"
|
14
|
+
)
|
15
|
+
|
16
|
+
alias diff_original diff
|
17
|
+
|
8
18
|
def diff(exp, act)
|
9
|
-
|
10
|
-
rescue StandardError
|
11
|
-
|
19
|
+
DIFFER.diff_objects(exp, act)
|
20
|
+
rescue StandardError => e
|
21
|
+
puts "Minitest::Difftastic error: #{e.inspect} (#{e.backtrace[0]})"
|
22
|
+
diff_original(exp, act)
|
12
23
|
end
|
13
24
|
end
|
14
25
|
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-difftastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Roth
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: difftastic
|
@@ -16,15 +16,15 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: '0.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
27
|
-
description: Minitest Plugin to use difftastic for
|
26
|
+
version: '0.2'
|
27
|
+
description: Minitest Plugin to use difftastic for failed assertions
|
28
28
|
email:
|
29
29
|
- marco.roth@intergga.ch
|
30
30
|
executables: []
|
@@ -41,6 +41,10 @@ files:
|
|
41
41
|
- lib/minitest/difftastic.rb
|
42
42
|
- lib/minitest/difftastic/version.rb
|
43
43
|
- lib/minitest/difftastic_plugin.rb
|
44
|
+
- screenshots/integers.png
|
45
|
+
- screenshots/nested_objects.png
|
46
|
+
- screenshots/objects.png
|
47
|
+
- screenshots/strings.png
|
44
48
|
- sig/minitest/difftastic.rbs
|
45
49
|
homepage: https://github.com/marcoroth/minitest-difftastic
|
46
50
|
licenses: []
|
@@ -57,15 +61,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
61
|
requirements:
|
58
62
|
- - ">="
|
59
63
|
- !ruby/object:Gem::Version
|
60
|
-
version: 3.
|
64
|
+
version: 3.1.0
|
61
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
66
|
requirements:
|
63
67
|
- - ">="
|
64
68
|
- !ruby/object:Gem::Version
|
65
69
|
version: '0'
|
66
70
|
requirements: []
|
67
|
-
rubygems_version: 3.
|
71
|
+
rubygems_version: 3.5.11
|
68
72
|
signing_key:
|
69
73
|
specification_version: 4
|
70
|
-
summary: Minitest Plugin to use difftastic for
|
74
|
+
summary: Minitest Plugin to use difftastic for failed assertions
|
71
75
|
test_files: []
|