minitest-difftastic 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d603a327fc8fce58c1ef00a079628ac03ceef45e5dccb959111f19be4fb0391b
4
- data.tar.gz: 4639b7123d9158ffb7629c8e07e0b90b5c8f3606718e8588fc61b61b504835c3
3
+ metadata.gz: 64691f1a85d150dae7c9c7894282b4443d089f4c7538c407073d48af5dc15f1c
4
+ data.tar.gz: 0f8f076b354274432deae363a4e6b892b788a07f92a7523c445efa79a3b9e9a8
5
5
  SHA512:
6
- metadata.gz: 9417837255131ee678670cda378c42e9afcfe8a07975647307b16f70b9139965f92c6f998f8ef0e6f68a4e7837117f44349d6f928259126d748e5c0efa1b8559
7
- data.tar.gz: 8c019e2e12b9506a66bd5c766a7b4cbe85d744610a190fafeec35f5593d7ffccc43b0ac016a6ba7a05f459854a59204a75b019dd75d4a2303c8de1b64021c655
6
+ metadata.gz: ff9ba0933ff4f965554e2adf8195c2768388425301dcc4b8e53ee070d62aea9cb88ed0e120e0f05c9c8ae8e642ed3561f4cd4b942682712a9aca910ec308b8ee
7
+ data.tar.gz: 3b7e5c719343600c1c3aff4c071793e9d5087b53b78d642371adb84c1c4a5d12a5968645f5079fbc0270da42fa58b1f06a6b3c721c712664ceda1dd44ab9a957
data/.rubocop.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  AllCops:
2
2
  NewCops: enable
3
3
  SuggestExtensions: false
4
- TargetRubyVersion: 3.0
4
+ TargetRubyVersion: 3.1
5
5
 
6
6
  Style/StringLiterals:
7
7
  Enabled: true
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minitest-difftastic (0.1.0)
5
- difftastic (~> 0.0.1)
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.1-arm64-darwin)
13
- difftastic (0.0.1-x86_64-linux)
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:
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Minitest
4
4
  module Difftastic
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
@@ -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
- ::Difftastic::Differ.new(color: :always, tab_width: 2, syntax_highlight: :off).diff_objects(exp, act)
10
- rescue StandardError
11
- super
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.0
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-21 00:00:00.000000000 Z
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.0.1
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.0.1
27
- description: Minitest Plugin to use difftastic for diffing
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.0.0
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.4.10
71
+ rubygems_version: 3.5.11
68
72
  signing_key:
69
73
  specification_version: 4
70
- summary: Minitest Plugin to use difftastic for diffing
74
+ summary: Minitest Plugin to use difftastic for failed assertions
71
75
  test_files: []