pretty-diffs 1.0.1 → 1.0.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
  SHA1:
3
- metadata.gz: c2aafe36b6f7cbb663cb2107ad6e1aad190e6e57
4
- data.tar.gz: 2ab5034192960b730f7ed94a199c6f01d09918be
3
+ metadata.gz: 7cc6ffd50247d89fb5f28fb2a724dd2744374250
4
+ data.tar.gz: 3ebe45d328166a23036aa0aa27061f282e42ab3c
5
5
  SHA512:
6
- metadata.gz: c37877e9026a4a73d54d6d38a8381b15e2c77afb43534be2adfa07306dab9ee766c3db69664f31ed97900fad01b1a9d3f1b7f5ea5e4c442389ed2ba8f30a0d70
7
- data.tar.gz: 62a8326fd86410031579fd090fb5c827ab14cfe84b22f96362b63d55a7792d0dc170432dd9a05adccfef825b400536186eafd4d17bd6882197b24c552ad9a184
6
+ metadata.gz: 87b22876ba598b003f9d9e0e77c4c953ff2c5d7bc244c1a05880cda812575f605f8f867dbba76ea947a31f6392a1d0264b73f45b26e3179dfa5fa1d2da96cd85
7
+ data.tar.gz: f5787eabfe593c3defc9b5fc91330f8f6a033f69405d0731f17f60b5131d59e2f432e00afdff5c4e1ce9e0233757473f6e0e806b9a43e1c222bb6bb045ba6bbe
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pretty-diffs (1.0)
4
+ pretty-diffs (1.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -19,4 +19,4 @@ DEPENDENCIES
19
19
  rake (~> 10.0)
20
20
 
21
21
  BUNDLED WITH
22
- 1.11.2
22
+ 1.15.4
data/README.md CHANGED
@@ -1,10 +1,15 @@
1
1
  # PrettyDiffs
2
2
 
3
- When you make assertions between large strings with minitest, for example JSON responses, it is laborious to identify what has changed. The usual workflow involves copy-pasting the output into a diff tool; a rather boring and time-consuming process.
3
+ A small gem to lubricate your testing workflow with prettier than usual diffs.
4
4
 
5
- Minitest chooses to compare strings using `diff`, which is line-oriented. However, 99% of the time, we do not intend to compare lines, we want just the words.
5
+ ## Motivation
6
+ When you make assertions between large strings with Minitest, for example JSON responses, it is laborious to identify what has changed. The usual workflow involves copy-pasting the output into a diff tool; a rather boring and time-consuming process.
6
7
 
7
- PrettyDiffs is a tool that supports this desire by overriding the default minitest method, and relieves our workflow.
8
+ Minitest chooses to compare strings using `diff`, which is line-oriented. However, 99% of the time, we do not intend to compare lines, we want just the words.
9
+
10
+ PrettyDiffs is a tool that supports this desire by overriding the default Minitest method, and relieves our workflow.
11
+
12
+ ## Screenshots
8
13
  ### Default Diff output
9
14
  ![before](./images/before.png)
10
15
 
@@ -18,7 +23,7 @@ Wdiff is a wrapper around diff, it works by creating two temporary files, one w
18
23
 
19
24
  ```
20
25
  # mac
21
- $ brew install wdiff 
26
+ $ brew install wdiff 
22
27
 
23
28
  # linux
24
29
  $ apt get-install wdiff 
@@ -30,7 +35,7 @@ Add this line to your application's Gemfile:
30
35
 
31
36
  ```ruby
32
37
  group :test do
33
- gem 'pretty_diffs'
38
+ gem 'pretty-diffs'
34
39
  end
35
40
  ```
36
41
 
@@ -43,10 +48,10 @@ $ bundle
43
48
  Or install it yourself as:
44
49
 
45
50
  ```
46
- $ gem install pretty_diffs
51
+ $ gem install pretty-diffs
47
52
  ```
48
53
 
49
- ## Usage
54
+ ## How to use
50
55
  Include the module in the Minitest classes to trigger the pretty diffs:
51
56
 
52
57
  ```ruby
@@ -54,7 +59,7 @@ require 'pretty_diffs'
54
59
 
55
60
  module ActiveSupport
56
61
  
 class TestCase
57
- include PrettyDiffs
62
+ include PrettyDiffs # add this line
58
63
 
59
64
  end
60
65
  end
@@ -67,6 +72,13 @@ In this rare case, set the following ENV variable:
67
72
  MINITEST_PLAIN_BORING_DIFF='yes'
68
73
  ```
69
74
 
75
+ ## Tests
76
+ ```sh
77
+ $ rake
78
+ ```
79
+
80
+ ## Tasks for version 1.1.0
81
+ * Pure JSON output instead of Hash when comparing JSON responses in controller tests, so to copy-paste directly.
70
82
 
71
83
  ## Contributing
72
84
 
@@ -75,3 +87,27 @@ MINITEST_PLAIN_BORING_DIFF='yes'
75
87
  3. Commit your changes (`git commit -am 'Add some feature'`)
76
88
  4. Push to the branch (`git push origin my-new-feature`)
77
89
  5. Create new Pull Request
90
+
91
+ ## License
92
+
93
+ The MIT License (MIT)
94
+
95
+ Copyright (c) 2016 Angelos Karagkiozidis
96
+
97
+ Permission is hereby granted, free of charge, to any person obtaining a copy
98
+ of this software and associated documentation files (the "Software"), to deal
99
+ in the Software without restriction, including without limitation the rights
100
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
101
+ copies of the Software, and to permit persons to whom the Software is
102
+ furnished to do so, subject to the following conditions:
103
+
104
+ The above copyright notice and this permission notice shall be included in
105
+ all copies or substantial portions of the Software.
106
+
107
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
108
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
109
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
110
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
111
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
112
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
113
+ THE SOFTWARE.
data/images/after.png CHANGED
Binary file
data/images/before.png CHANGED
Binary file
data/lib/pretty_diffs.rb CHANGED
@@ -24,7 +24,7 @@ module PrettyDiffs
24
24
  end
25
25
 
26
26
  def verify_wdiff_in_path
27
- %x{which wdiff}.present?
27
+ !%x{which wdiff}.empty?
28
28
  end
29
29
 
30
30
  def boring_diffs?
@@ -1,3 +1,3 @@
1
1
  module PrettyDiffs
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty-diffs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angelos Karagkiozidis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-12 00:00:00.000000000 Z
11
+ date: 2017-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,9 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.6.7
97
+ rubygems_version: 2.6.13
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Enable colored diffs in minitest.
101
101
  test_files: []
102
- has_rdoc: