rspec-difftastic 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/lib/rspec-difftastic.rb +21 -0
  4. metadata +76 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bad2e86e9eb0d35973a7e0319fb15925ad3c897e5ff809de70d2f69701f8bb74
4
+ data.tar.gz: b2f09cb6cd23fc8a03cd1d9cbc8af872c485f0588c4fbf9a37e8f66c95448219
5
+ SHA512:
6
+ metadata.gz: eb5ca82dc0345ab8d939e2ea1f8176db9483b4723878666cca9201bab6075910d5e084a6971af8fbd24c669c9ffc2dbc56502271b5eec9059acd77548041bceb
7
+ data.tar.gz: 8b27d544b44be9bc5642b5046af22dc3baaa6c523e2ebe455d71f1a46fe7567a9e5b658913c3668e3559b2cc0ebf8e4d4fbd9af1a68bce89cfead3e6583fbcfd
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 @sealocal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ require 'difftastic'
2
+
3
+ module RSpec
4
+ module Support
5
+ class Differ
6
+
7
+ DIFFTASTIC_DIFFER = Difftastic::Differ.new(
8
+ background: :dark,
9
+ color: :always,
10
+ left_label: "Expected",
11
+ right_label: "Actual"
12
+ )
13
+
14
+ def diff_as_string(actual, expected)
15
+ diff_string = DIFFTASTIC_DIFFER.diff_strings(actual, expected)
16
+ "\n\n#{diff_string}\n"
17
+ end
18
+
19
+ end
20
+ end
21
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-difftastic
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mike Taylor
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-02-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: difftastic
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.6.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.6.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
41
+ description: This is a quick patch implementation and may not cover edge cases. To
42
+ reduce disruptions and maximize usefulness, difftastic is only applied when RSpec
43
+ diffs strings.
44
+ email: github@miket.dev
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - LICENSE
50
+ - lib/rspec-difftastic.rb
51
+ homepage: https://github.com/sealocal/rspec-difftastic
52
+ licenses:
53
+ - MIT
54
+ metadata:
55
+ homepage_uri: https://github.com/sealocal/rspec-difftastic
56
+ changelog_uri: https://github.com/sealocal/rspec-difftastic/releases
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.4.19
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Use difftastic in place of RSpec's default differ.
76
+ test_files: []