super_diff 0.3.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +104 -73
  3. data/lib/super_diff.rb +20 -11
  4. data/lib/super_diff/active_record.rb +21 -23
  5. data/lib/super_diff/active_record/diff_formatters/active_record_relation.rb +3 -3
  6. data/lib/super_diff/active_record/differs/active_record_relation.rb +3 -5
  7. data/lib/super_diff/active_record/monkey_patches.rb +9 -0
  8. data/lib/super_diff/active_record/object_inspection/inspectors/active_record_model.rb +32 -22
  9. data/lib/super_diff/active_record/object_inspection/inspectors/active_record_relation.rb +17 -7
  10. data/lib/super_diff/active_record/operation_tree_builders.rb +14 -0
  11. data/lib/super_diff/active_record/{operational_sequencers → operation_tree_builders}/active_record_model.rb +2 -2
  12. data/lib/super_diff/active_record/{operational_sequencers → operation_tree_builders}/active_record_relation.rb +4 -4
  13. data/lib/super_diff/active_record/{operation_sequences.rb → operation_trees.rb} +2 -2
  14. data/lib/super_diff/active_record/{operation_sequences → operation_trees}/active_record_relation.rb +2 -2
  15. data/lib/super_diff/active_support.rb +16 -19
  16. data/lib/super_diff/active_support/diff_formatters/hash_with_indifferent_access.rb +3 -3
  17. data/lib/super_diff/active_support/differs/hash_with_indifferent_access.rb +3 -5
  18. data/lib/super_diff/active_support/object_inspection/inspectors/hash_with_indifferent_access.rb +17 -7
  19. data/lib/super_diff/active_support/operation_tree_builders.rb +10 -0
  20. data/lib/super_diff/active_support/{operational_sequencers → operation_tree_builders}/hash_with_indifferent_access.rb +2 -2
  21. data/lib/super_diff/active_support/{operation_sequences.rb → operation_trees.rb} +2 -2
  22. data/lib/super_diff/active_support/{operation_sequences → operation_trees}/hash_with_indifferent_access.rb +2 -2
  23. data/lib/super_diff/configuration.rb +60 -0
  24. data/lib/super_diff/csi.rb +4 -0
  25. data/lib/super_diff/diff_formatters.rb +3 -3
  26. data/lib/super_diff/diff_formatters/array.rb +3 -3
  27. data/lib/super_diff/diff_formatters/base.rb +3 -2
  28. data/lib/super_diff/diff_formatters/collection.rb +2 -2
  29. data/lib/super_diff/diff_formatters/custom_object.rb +3 -3
  30. data/lib/super_diff/diff_formatters/default_object.rb +6 -8
  31. data/lib/super_diff/diff_formatters/defaults.rb +10 -0
  32. data/lib/super_diff/diff_formatters/hash.rb +3 -3
  33. data/lib/super_diff/diff_formatters/main.rb +41 -0
  34. data/lib/super_diff/diff_formatters/multiline_string.rb +3 -3
  35. data/lib/super_diff/differs.rb +4 -11
  36. data/lib/super_diff/differs/array.rb +2 -11
  37. data/lib/super_diff/differs/base.rb +20 -3
  38. data/lib/super_diff/differs/custom_object.rb +2 -11
  39. data/lib/super_diff/differs/default_object.rb +2 -8
  40. data/lib/super_diff/differs/defaults.rb +12 -0
  41. data/lib/super_diff/differs/hash.rb +2 -11
  42. data/lib/super_diff/differs/main.rb +48 -0
  43. data/lib/super_diff/differs/multiline_string.rb +2 -14
  44. data/lib/super_diff/differs/time_like.rb +15 -0
  45. data/lib/super_diff/equality_matchers.rb +3 -9
  46. data/lib/super_diff/equality_matchers/array.rb +1 -7
  47. data/lib/super_diff/equality_matchers/base.rb +1 -1
  48. data/lib/super_diff/equality_matchers/default.rb +2 -8
  49. data/lib/super_diff/equality_matchers/defaults.rb +12 -0
  50. data/lib/super_diff/equality_matchers/hash.rb +1 -7
  51. data/lib/super_diff/equality_matchers/main.rb +21 -0
  52. data/lib/super_diff/equality_matchers/multiline_string.rb +1 -7
  53. data/lib/super_diff/errors.rb +16 -0
  54. data/lib/super_diff/errors/no_diff_formatter_available_error.rb +21 -0
  55. data/lib/super_diff/errors/no_differ_available_error.rb +24 -0
  56. data/lib/super_diff/errors/no_operational_sequencer_available_error.rb +22 -0
  57. data/lib/super_diff/implementation_checks.rb +19 -0
  58. data/lib/super_diff/object_inspection.rb +1 -10
  59. data/lib/super_diff/object_inspection/inspection_tree.rb +6 -2
  60. data/lib/super_diff/object_inspection/inspectors.rb +5 -1
  61. data/lib/super_diff/object_inspection/inspectors/array.rb +20 -10
  62. data/lib/super_diff/object_inspection/inspectors/base.rb +36 -0
  63. data/lib/super_diff/object_inspection/inspectors/custom_object.rb +24 -14
  64. data/lib/super_diff/object_inspection/inspectors/default_object.rb +44 -30
  65. data/lib/super_diff/object_inspection/inspectors/defaults.rb +15 -0
  66. data/lib/super_diff/object_inspection/inspectors/hash.rb +20 -10
  67. data/lib/super_diff/object_inspection/inspectors/main.rb +35 -0
  68. data/lib/super_diff/object_inspection/inspectors/primitive.rb +20 -5
  69. data/lib/super_diff/object_inspection/inspectors/string.rb +15 -5
  70. data/lib/super_diff/object_inspection/inspectors/time_like.rb +23 -0
  71. data/lib/super_diff/object_inspection/nodes/inspection.rb +9 -2
  72. data/lib/super_diff/operation_tree_builders.rb +18 -0
  73. data/lib/super_diff/{operational_sequencers → operation_tree_builders}/array.rb +38 -59
  74. data/lib/super_diff/operation_tree_builders/base.rb +98 -0
  75. data/lib/super_diff/{operational_sequencers → operation_tree_builders}/custom_object.rb +3 -3
  76. data/lib/super_diff/{operational_sequencers → operation_tree_builders}/default_object.rb +8 -3
  77. data/lib/super_diff/operation_tree_builders/defaults.rb +5 -0
  78. data/lib/super_diff/operation_tree_builders/hash.rb +226 -0
  79. data/lib/super_diff/operation_tree_builders/main.rb +42 -0
  80. data/lib/super_diff/{operational_sequencers → operation_tree_builders}/multiline_string.rb +3 -3
  81. data/lib/super_diff/operation_tree_builders/time_like.rb +34 -0
  82. data/lib/super_diff/operation_trees.rb +13 -0
  83. data/lib/super_diff/{operation_sequences → operation_trees}/array.rb +5 -1
  84. data/lib/super_diff/operation_trees/base.rb +31 -0
  85. data/lib/super_diff/{operation_sequences → operation_trees}/custom_object.rb +5 -1
  86. data/lib/super_diff/{operation_sequences → operation_trees}/default_object.rb +10 -8
  87. data/lib/super_diff/operation_trees/defaults.rb +5 -0
  88. data/lib/super_diff/{operation_sequences → operation_trees}/hash.rb +5 -1
  89. data/lib/super_diff/operation_trees/main.rb +35 -0
  90. data/lib/super_diff/operation_trees/multiline_string.rb +18 -0
  91. data/lib/super_diff/operations/unary_operation.rb +3 -0
  92. data/lib/super_diff/rspec.rb +54 -22
  93. data/lib/super_diff/rspec/augmented_matcher.rb +1 -1
  94. data/lib/super_diff/rspec/differ.rb +2 -17
  95. data/lib/super_diff/rspec/differs.rb +9 -3
  96. data/lib/super_diff/rspec/differs/collection_containing_exactly.rb +3 -8
  97. data/lib/super_diff/rspec/differs/collection_including.rb +18 -0
  98. data/lib/super_diff/rspec/differs/hash_including.rb +18 -0
  99. data/lib/super_diff/rspec/differs/object_having_attributes.rb +17 -0
  100. data/lib/super_diff/rspec/matcher_text_builders.rb +4 -0
  101. data/lib/super_diff/rspec/matcher_text_builders/be_predicate.rb +26 -7
  102. data/lib/super_diff/rspec/matcher_text_builders/have_predicate.rb +61 -0
  103. data/lib/super_diff/rspec/matcher_text_builders/match.rb +1 -1
  104. data/lib/super_diff/rspec/matcher_text_builders/raise_error.rb +13 -1
  105. data/lib/super_diff/rspec/matcher_text_builders/respond_to.rb +1 -1
  106. data/lib/super_diff/rspec/matcher_text_template.rb +1 -1
  107. data/lib/super_diff/rspec/monkey_patches.rb +226 -115
  108. data/lib/super_diff/rspec/object_inspection.rb +0 -1
  109. data/lib/super_diff/rspec/object_inspection/inspectors.rb +22 -6
  110. data/lib/super_diff/rspec/object_inspection/inspectors/collection_containing_exactly.rb +17 -8
  111. data/lib/super_diff/rspec/object_inspection/inspectors/collection_including.rb +28 -0
  112. data/lib/super_diff/rspec/object_inspection/inspectors/hash_including.rb +31 -0
  113. data/lib/super_diff/rspec/object_inspection/inspectors/instance_of.rb +23 -0
  114. data/lib/super_diff/rspec/object_inspection/inspectors/kind_of.rb +23 -0
  115. data/lib/super_diff/rspec/object_inspection/inspectors/object_having_attributes.rb +31 -0
  116. data/lib/super_diff/rspec/object_inspection/inspectors/primitive.rb +13 -0
  117. data/lib/super_diff/rspec/object_inspection/inspectors/value_within.rb +29 -0
  118. data/lib/super_diff/rspec/operation_tree_builders.rb +22 -0
  119. data/lib/super_diff/rspec/{operational_sequencers → operation_tree_builders}/collection_containing_exactly.rb +6 -6
  120. data/lib/super_diff/rspec/{operational_sequencers/partial_array.rb → operation_tree_builders/collection_including.rb} +4 -3
  121. data/lib/super_diff/rspec/operation_tree_builders/hash_including.rb +25 -0
  122. data/lib/super_diff/rspec/{operational_sequencers/partial_object.rb → operation_tree_builders/object_having_attributes.rb} +5 -11
  123. data/lib/super_diff/version.rb +1 -1
  124. data/spec/examples.txt +5 -350
  125. data/spec/integration/rails/active_record_spec.rb +1 -1
  126. data/spec/integration/rails/hash_with_indifferent_access_spec.rb +1 -1
  127. data/spec/integration/rspec/be_predicate_matcher_spec.rb +111 -59
  128. data/spec/integration/rspec/eq_matcher_spec.rb +1 -1
  129. data/spec/integration/rspec/have_attributes_matcher_spec.rb +354 -227
  130. data/spec/integration/rspec/have_predicate_matcher_spec.rb +484 -0
  131. data/spec/integration/rspec/include_matcher_spec.rb +2 -2
  132. data/spec/integration/rspec/match_array_matcher_spec.rb +372 -0
  133. data/spec/integration/rspec/match_matcher_spec.rb +8 -8
  134. data/spec/integration/rspec/raise_error_matcher_spec.rb +605 -226
  135. data/spec/integration/rspec/third_party_matcher_spec.rb +241 -0
  136. data/spec/integration/rspec/unhandled_errors_spec.rb +110 -58
  137. data/spec/spec_helper.rb +18 -7
  138. data/spec/support/command_runner.rb +3 -0
  139. data/spec/support/integration/helpers.rb +14 -90
  140. data/spec/support/integration/matchers.rb +143 -0
  141. data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +14 -29
  142. data/spec/support/integration/test_programs/base.rb +120 -0
  143. data/spec/support/integration/test_programs/plain.rb +13 -0
  144. data/spec/support/integration/test_programs/rspec_active_record.rb +17 -0
  145. data/spec/support/integration/test_programs/rspec_rails.rb +17 -0
  146. data/spec/support/models/active_record/person.rb +4 -11
  147. data/spec/support/models/active_record/query.rb +15 -0
  148. data/spec/support/models/active_record/shipping_address.rb +10 -14
  149. data/spec/support/object_id.rb +27 -0
  150. data/spec/support/ruby_versions.rb +4 -0
  151. data/spec/support/shared_examples/active_record.rb +71 -0
  152. data/spec/support/shared_examples/hash_with_indifferent_access.rb +724 -208
  153. data/spec/unit/{equality_matcher_spec.rb → equality_matchers/main_spec.rb} +165 -9
  154. data/spec/unit/object_inspection_spec.rb +94 -18
  155. data/spec/unit/rspec/matchers/have_predicate_spec.rb +21 -0
  156. data/spec/unit/rspec/matchers/match_array_spec.rb +11 -0
  157. data/spec/unit/rspec/matchers/raise_error_spec.rb +16 -0
  158. data/super_diff.gemspec +4 -6
  159. metadata +99 -82
  160. data/lib/super_diff/active_record/object_inspection/map_extension.rb +0 -18
  161. data/lib/super_diff/active_record/operational_sequencers.rb +0 -14
  162. data/lib/super_diff/active_support/object_inspection/map_extension.rb +0 -15
  163. data/lib/super_diff/active_support/operational_sequencers.rb +0 -10
  164. data/lib/super_diff/diff_formatter.rb +0 -32
  165. data/lib/super_diff/differ.rb +0 -51
  166. data/lib/super_diff/differs/time.rb +0 -24
  167. data/lib/super_diff/equality_matcher.rb +0 -32
  168. data/lib/super_diff/no_differ_available_error.rb +0 -22
  169. data/lib/super_diff/no_operational_sequencer_available_error.rb +0 -20
  170. data/lib/super_diff/object_inspection/inspector.rb +0 -27
  171. data/lib/super_diff/object_inspection/inspectors/time.rb +0 -13
  172. data/lib/super_diff/object_inspection/map.rb +0 -30
  173. data/lib/super_diff/operation_sequences.rb +0 -9
  174. data/lib/super_diff/operation_sequences/base.rb +0 -11
  175. data/lib/super_diff/operational_sequencer.rb +0 -48
  176. data/lib/super_diff/operational_sequencers.rb +0 -17
  177. data/lib/super_diff/operational_sequencers/base.rb +0 -89
  178. data/lib/super_diff/operational_sequencers/hash.rb +0 -85
  179. data/lib/super_diff/operational_sequencers/time_like.rb +0 -30
  180. data/lib/super_diff/rspec/configuration.rb +0 -31
  181. data/lib/super_diff/rspec/differs/partial_array.rb +0 -22
  182. data/lib/super_diff/rspec/differs/partial_hash.rb +0 -22
  183. data/lib/super_diff/rspec/differs/partial_object.rb +0 -22
  184. data/lib/super_diff/rspec/object_inspection/inspectors/partial_array.rb +0 -22
  185. data/lib/super_diff/rspec/object_inspection/inspectors/partial_hash.rb +0 -21
  186. data/lib/super_diff/rspec/object_inspection/inspectors/partial_object.rb +0 -21
  187. data/lib/super_diff/rspec/object_inspection/map_extension.rb +0 -23
  188. data/lib/super_diff/rspec/operational_sequencers.rb +0 -22
  189. data/lib/super_diff/rspec/operational_sequencers/partial_hash.rb +0 -32
@@ -18,6 +18,14 @@ RSpec.describe "RSpec's `raise_error` matcher" do
18
18
  end
19
19
  end
20
20
 
21
+ context "with regular expression as message (and assuming a RuntimeError)" do
22
+ it "returns the correct output" do
23
+ expect(raise_error(/hell/).description).to eq(
24
+ %|raise error #<Exception /hell/>|,
25
+ )
26
+ end
27
+ end
28
+
21
29
  context "with both an exception and a message" do
22
30
  it "returns the correct output" do
23
31
  expect(raise_error(RuntimeError, "hell").description).to eq(
@@ -25,5 +33,13 @@ RSpec.describe "RSpec's `raise_error` matcher" do
25
33
  )
26
34
  end
27
35
  end
36
+
37
+ context "with an exception and a regular expression as message" do
38
+ it "returns the correct output" do
39
+ expect(raise_error(RuntimeError, /hell/).description).to eq(
40
+ %|raise error #<RuntimeError /hell/>|,
41
+ )
42
+ end
43
+ end
28
44
  end
29
45
  end
@@ -6,11 +6,10 @@ Gem::Specification.new do |s|
6
6
  s.authors = ["Elliot Winkler"]
7
7
  s.email = ["elliot.winkler@gmail.com"]
8
8
  s.homepage = "https://github.com/mcmire/super_diff"
9
- s.summary = "Diff complex data structures in Ruby, with helpful output."
9
+ s.summary = "A better way to view differences between complex data structures in RSpec."
10
10
  s.description = <<~DESC
11
- SuperDiff is a utility that helps you diff two complex data structures in
12
- Ruby, and gives you helpful output to show you exactly how the two data
13
- structures differ.
11
+ SuperDiff is a gem that hooks into RSpec to intelligently display the
12
+ differences between two data structures of any type.
14
13
  DESC
15
14
  s.required_ruby_version = "~> 2.4"
16
15
 
@@ -18,8 +17,7 @@ Gem::Specification.new do |s|
18
17
  s.test_files = Dir["spec/**/*"]
19
18
  s.executables = Dir["exe/**/*"].map { |f| File.basename(f) }
20
19
 
21
- s.add_dependency "activerecord", "> 4.2", "< 7.0"
22
- s.add_dependency "attr_extras"
20
+ s.add_dependency "attr_extras", '>= 6.2.4'
23
21
  s.add_dependency "diff-lcs"
24
22
  s.add_dependency "patience_diff"
25
23
  end
metadata CHANGED
@@ -1,49 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Winkler
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-18 00:00:00.000000000 Z
11
+ date: 2020-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activerecord
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">"
18
- - !ruby/object:Gem::Version
19
- version: '4.2'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '7.0'
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - ">"
28
- - !ruby/object:Gem::Version
29
- version: '4.2'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '7.0'
33
13
  - !ruby/object:Gem::Dependency
34
14
  name: attr_extras
35
15
  requirement: !ruby/object:Gem::Requirement
36
16
  requirements:
37
17
  - - ">="
38
18
  - !ruby/object:Gem::Version
39
- version: '0'
19
+ version: 6.2.4
40
20
  type: :runtime
41
21
  prerelease: false
42
22
  version_requirements: !ruby/object:Gem::Requirement
43
23
  requirements:
44
24
  - - ">="
45
25
  - !ruby/object:Gem::Version
46
- version: '0'
26
+ version: 6.2.4
47
27
  - !ruby/object:Gem::Dependency
48
28
  name: diff-lcs
49
29
  requirement: !ruby/object:Gem::Requirement
@@ -73,9 +53,8 @@ dependencies:
73
53
  - !ruby/object:Gem::Version
74
54
  version: '0'
75
55
  description: |
76
- SuperDiff is a utility that helps you diff two complex data structures in
77
- Ruby, and gives you helpful output to show you exactly how the two data
78
- structures differ.
56
+ SuperDiff is a gem that hooks into RSpec to intelligently display the
57
+ differences between two data structures of any type.
79
58
  email:
80
59
  - elliot.winkler@gmail.com
81
60
  executables: []
@@ -89,16 +68,16 @@ files:
89
68
  - lib/super_diff/active_record/diff_formatters/active_record_relation.rb
90
69
  - lib/super_diff/active_record/differs.rb
91
70
  - lib/super_diff/active_record/differs/active_record_relation.rb
71
+ - lib/super_diff/active_record/monkey_patches.rb
92
72
  - lib/super_diff/active_record/object_inspection.rb
93
73
  - lib/super_diff/active_record/object_inspection/inspectors.rb
94
74
  - lib/super_diff/active_record/object_inspection/inspectors/active_record_model.rb
95
75
  - lib/super_diff/active_record/object_inspection/inspectors/active_record_relation.rb
96
- - lib/super_diff/active_record/object_inspection/map_extension.rb
97
- - lib/super_diff/active_record/operation_sequences.rb
98
- - lib/super_diff/active_record/operation_sequences/active_record_relation.rb
99
- - lib/super_diff/active_record/operational_sequencers.rb
100
- - lib/super_diff/active_record/operational_sequencers/active_record_model.rb
101
- - lib/super_diff/active_record/operational_sequencers/active_record_relation.rb
76
+ - lib/super_diff/active_record/operation_tree_builders.rb
77
+ - lib/super_diff/active_record/operation_tree_builders/active_record_model.rb
78
+ - lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb
79
+ - lib/super_diff/active_record/operation_trees.rb
80
+ - lib/super_diff/active_record/operation_trees/active_record_relation.rb
102
81
  - lib/super_diff/active_support.rb
103
82
  - lib/super_diff/active_support/diff_formatters.rb
104
83
  - lib/super_diff/active_support/diff_formatters/hash_with_indifferent_access.rb
@@ -107,12 +86,12 @@ files:
107
86
  - lib/super_diff/active_support/object_inspection.rb
108
87
  - lib/super_diff/active_support/object_inspection/inspectors.rb
109
88
  - lib/super_diff/active_support/object_inspection/inspectors/hash_with_indifferent_access.rb
110
- - lib/super_diff/active_support/object_inspection/map_extension.rb
111
- - lib/super_diff/active_support/operation_sequences.rb
112
- - lib/super_diff/active_support/operation_sequences/hash_with_indifferent_access.rb
113
- - lib/super_diff/active_support/operational_sequencers.rb
114
- - lib/super_diff/active_support/operational_sequencers/hash_with_indifferent_access.rb
89
+ - lib/super_diff/active_support/operation_tree_builders.rb
90
+ - lib/super_diff/active_support/operation_tree_builders/hash_with_indifferent_access.rb
91
+ - lib/super_diff/active_support/operation_trees.rb
92
+ - lib/super_diff/active_support/operation_trees/hash_with_indifferent_access.rb
115
93
  - lib/super_diff/colorized_document_extensions.rb
94
+ - lib/super_diff/configuration.rb
116
95
  - lib/super_diff/csi.rb
117
96
  - lib/super_diff/csi/bold_sequence.rb
118
97
  - lib/super_diff/csi/color.rb
@@ -124,49 +103,56 @@ files:
124
103
  - lib/super_diff/csi/reset_sequence.rb
125
104
  - lib/super_diff/csi/twenty_four_bit_color.rb
126
105
  - lib/super_diff/csi/uncolorized_document.rb
127
- - lib/super_diff/diff_formatter.rb
128
106
  - lib/super_diff/diff_formatters.rb
129
107
  - lib/super_diff/diff_formatters/array.rb
130
108
  - lib/super_diff/diff_formatters/base.rb
131
109
  - lib/super_diff/diff_formatters/collection.rb
132
110
  - lib/super_diff/diff_formatters/custom_object.rb
133
111
  - lib/super_diff/diff_formatters/default_object.rb
112
+ - lib/super_diff/diff_formatters/defaults.rb
134
113
  - lib/super_diff/diff_formatters/hash.rb
114
+ - lib/super_diff/diff_formatters/main.rb
135
115
  - lib/super_diff/diff_formatters/multiline_string.rb
136
- - lib/super_diff/differ.rb
137
116
  - lib/super_diff/differs.rb
138
117
  - lib/super_diff/differs/array.rb
139
118
  - lib/super_diff/differs/base.rb
140
119
  - lib/super_diff/differs/custom_object.rb
141
120
  - lib/super_diff/differs/default_object.rb
121
+ - lib/super_diff/differs/defaults.rb
142
122
  - lib/super_diff/differs/empty.rb
143
123
  - lib/super_diff/differs/hash.rb
124
+ - lib/super_diff/differs/main.rb
144
125
  - lib/super_diff/differs/multiline_string.rb
145
- - lib/super_diff/differs/time.rb
146
- - lib/super_diff/equality_matcher.rb
126
+ - lib/super_diff/differs/time_like.rb
147
127
  - lib/super_diff/equality_matchers.rb
148
128
  - lib/super_diff/equality_matchers/array.rb
149
129
  - lib/super_diff/equality_matchers/base.rb
150
130
  - lib/super_diff/equality_matchers/default.rb
131
+ - lib/super_diff/equality_matchers/defaults.rb
151
132
  - lib/super_diff/equality_matchers/hash.rb
133
+ - lib/super_diff/equality_matchers/main.rb
152
134
  - lib/super_diff/equality_matchers/multiline_string.rb
153
135
  - lib/super_diff/equality_matchers/primitive.rb
154
136
  - lib/super_diff/equality_matchers/singleline_string.rb
137
+ - lib/super_diff/errors.rb
138
+ - lib/super_diff/errors/no_diff_formatter_available_error.rb
139
+ - lib/super_diff/errors/no_differ_available_error.rb
140
+ - lib/super_diff/errors/no_operational_sequencer_available_error.rb
155
141
  - lib/super_diff/helpers.rb
156
- - lib/super_diff/no_differ_available_error.rb
157
- - lib/super_diff/no_operational_sequencer_available_error.rb
142
+ - lib/super_diff/implementation_checks.rb
158
143
  - lib/super_diff/object_inspection.rb
159
144
  - lib/super_diff/object_inspection/inspection_tree.rb
160
- - lib/super_diff/object_inspection/inspector.rb
161
145
  - lib/super_diff/object_inspection/inspectors.rb
162
146
  - lib/super_diff/object_inspection/inspectors/array.rb
147
+ - lib/super_diff/object_inspection/inspectors/base.rb
163
148
  - lib/super_diff/object_inspection/inspectors/custom_object.rb
164
149
  - lib/super_diff/object_inspection/inspectors/default_object.rb
150
+ - lib/super_diff/object_inspection/inspectors/defaults.rb
165
151
  - lib/super_diff/object_inspection/inspectors/hash.rb
152
+ - lib/super_diff/object_inspection/inspectors/main.rb
166
153
  - lib/super_diff/object_inspection/inspectors/primitive.rb
167
154
  - lib/super_diff/object_inspection/inspectors/string.rb
168
- - lib/super_diff/object_inspection/inspectors/time.rb
169
- - lib/super_diff/object_inspection/map.rb
155
+ - lib/super_diff/object_inspection/inspectors/time_like.rb
170
156
  - lib/super_diff/object_inspection/nodes.rb
171
157
  - lib/super_diff/object_inspection/nodes/base.rb
172
158
  - lib/super_diff/object_inspection/nodes/break.rb
@@ -177,21 +163,25 @@ files:
177
163
  - lib/super_diff/object_inspection/nodes/when_multiline.rb
178
164
  - lib/super_diff/object_inspection/nodes/when_non_empty.rb
179
165
  - lib/super_diff/object_inspection/nodes/when_singleline.rb
180
- - lib/super_diff/operation_sequences.rb
181
- - lib/super_diff/operation_sequences/array.rb
182
- - lib/super_diff/operation_sequences/base.rb
183
- - lib/super_diff/operation_sequences/custom_object.rb
184
- - lib/super_diff/operation_sequences/default_object.rb
185
- - lib/super_diff/operation_sequences/hash.rb
186
- - lib/super_diff/operational_sequencer.rb
187
- - lib/super_diff/operational_sequencers.rb
188
- - lib/super_diff/operational_sequencers/array.rb
189
- - lib/super_diff/operational_sequencers/base.rb
190
- - lib/super_diff/operational_sequencers/custom_object.rb
191
- - lib/super_diff/operational_sequencers/default_object.rb
192
- - lib/super_diff/operational_sequencers/hash.rb
193
- - lib/super_diff/operational_sequencers/multiline_string.rb
194
- - lib/super_diff/operational_sequencers/time_like.rb
166
+ - lib/super_diff/operation_tree_builders.rb
167
+ - lib/super_diff/operation_tree_builders/array.rb
168
+ - lib/super_diff/operation_tree_builders/base.rb
169
+ - lib/super_diff/operation_tree_builders/custom_object.rb
170
+ - lib/super_diff/operation_tree_builders/default_object.rb
171
+ - lib/super_diff/operation_tree_builders/defaults.rb
172
+ - lib/super_diff/operation_tree_builders/hash.rb
173
+ - lib/super_diff/operation_tree_builders/main.rb
174
+ - lib/super_diff/operation_tree_builders/multiline_string.rb
175
+ - lib/super_diff/operation_tree_builders/time_like.rb
176
+ - lib/super_diff/operation_trees.rb
177
+ - lib/super_diff/operation_trees/array.rb
178
+ - lib/super_diff/operation_trees/base.rb
179
+ - lib/super_diff/operation_trees/custom_object.rb
180
+ - lib/super_diff/operation_trees/default_object.rb
181
+ - lib/super_diff/operation_trees/defaults.rb
182
+ - lib/super_diff/operation_trees/hash.rb
183
+ - lib/super_diff/operation_trees/main.rb
184
+ - lib/super_diff/operation_trees/multiline_string.rb
195
185
  - lib/super_diff/operations.rb
196
186
  - lib/super_diff/operations/binary_operation.rb
197
187
  - lib/super_diff/operations/unary_operation.rb
@@ -200,17 +190,17 @@ files:
200
190
  - lib/super_diff/rspec-rails.rb
201
191
  - lib/super_diff/rspec.rb
202
192
  - lib/super_diff/rspec/augmented_matcher.rb
203
- - lib/super_diff/rspec/configuration.rb
204
193
  - lib/super_diff/rspec/differ.rb
205
194
  - lib/super_diff/rspec/differs.rb
206
195
  - lib/super_diff/rspec/differs/collection_containing_exactly.rb
207
- - lib/super_diff/rspec/differs/partial_array.rb
208
- - lib/super_diff/rspec/differs/partial_hash.rb
209
- - lib/super_diff/rspec/differs/partial_object.rb
196
+ - lib/super_diff/rspec/differs/collection_including.rb
197
+ - lib/super_diff/rspec/differs/hash_including.rb
198
+ - lib/super_diff/rspec/differs/object_having_attributes.rb
210
199
  - lib/super_diff/rspec/matcher_text_builders.rb
211
200
  - lib/super_diff/rspec/matcher_text_builders/base.rb
212
201
  - lib/super_diff/rspec/matcher_text_builders/be_predicate.rb
213
202
  - lib/super_diff/rspec/matcher_text_builders/contain_exactly.rb
203
+ - lib/super_diff/rspec/matcher_text_builders/have_predicate.rb
214
204
  - lib/super_diff/rspec/matcher_text_builders/match.rb
215
205
  - lib/super_diff/rspec/matcher_text_builders/raise_error.rb
216
206
  - lib/super_diff/rspec/matcher_text_builders/respond_to.rb
@@ -219,15 +209,18 @@ files:
219
209
  - lib/super_diff/rspec/object_inspection.rb
220
210
  - lib/super_diff/rspec/object_inspection/inspectors.rb
221
211
  - lib/super_diff/rspec/object_inspection/inspectors/collection_containing_exactly.rb
222
- - lib/super_diff/rspec/object_inspection/inspectors/partial_array.rb
223
- - lib/super_diff/rspec/object_inspection/inspectors/partial_hash.rb
224
- - lib/super_diff/rspec/object_inspection/inspectors/partial_object.rb
225
- - lib/super_diff/rspec/object_inspection/map_extension.rb
226
- - lib/super_diff/rspec/operational_sequencers.rb
227
- - lib/super_diff/rspec/operational_sequencers/collection_containing_exactly.rb
228
- - lib/super_diff/rspec/operational_sequencers/partial_array.rb
229
- - lib/super_diff/rspec/operational_sequencers/partial_hash.rb
230
- - lib/super_diff/rspec/operational_sequencers/partial_object.rb
212
+ - lib/super_diff/rspec/object_inspection/inspectors/collection_including.rb
213
+ - lib/super_diff/rspec/object_inspection/inspectors/hash_including.rb
214
+ - lib/super_diff/rspec/object_inspection/inspectors/instance_of.rb
215
+ - lib/super_diff/rspec/object_inspection/inspectors/kind_of.rb
216
+ - lib/super_diff/rspec/object_inspection/inspectors/object_having_attributes.rb
217
+ - lib/super_diff/rspec/object_inspection/inspectors/primitive.rb
218
+ - lib/super_diff/rspec/object_inspection/inspectors/value_within.rb
219
+ - lib/super_diff/rspec/operation_tree_builders.rb
220
+ - lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb
221
+ - lib/super_diff/rspec/operation_tree_builders/collection_including.rb
222
+ - lib/super_diff/rspec/operation_tree_builders/hash_including.rb
223
+ - lib/super_diff/rspec/operation_tree_builders/object_having_attributes.rb
231
224
  - lib/super_diff/version.rb
232
225
  - spec/examples.txt
233
226
  - spec/integration/rails/active_record_spec.rb
@@ -240,18 +233,27 @@ files:
240
233
  - spec/integration/rspec/contain_exactly_matcher_spec.rb
241
234
  - spec/integration/rspec/eq_matcher_spec.rb
242
235
  - spec/integration/rspec/have_attributes_matcher_spec.rb
236
+ - spec/integration/rspec/have_predicate_matcher_spec.rb
243
237
  - spec/integration/rspec/include_matcher_spec.rb
238
+ - spec/integration/rspec/match_array_matcher_spec.rb
244
239
  - spec/integration/rspec/match_matcher_spec.rb
245
240
  - spec/integration/rspec/raise_error_matcher_spec.rb
246
241
  - spec/integration/rspec/respond_to_matcher_spec.rb
242
+ - spec/integration/rspec/third_party_matcher_spec.rb
247
243
  - spec/integration/rspec/unhandled_errors_spec.rb
248
244
  - spec/spec_helper.rb
249
245
  - spec/support/colorizer.rb
250
246
  - spec/support/command_runner.rb
251
247
  - spec/support/integration/helpers.rb
248
+ - spec/support/integration/matchers.rb
252
249
  - spec/support/integration/matchers/produce_output_when_run_matcher.rb
250
+ - spec/support/integration/test_programs/base.rb
251
+ - spec/support/integration/test_programs/plain.rb
252
+ - spec/support/integration/test_programs/rspec_active_record.rb
253
+ - spec/support/integration/test_programs/rspec_rails.rb
253
254
  - spec/support/models/a.rb
254
255
  - spec/support/models/active_record/person.rb
256
+ - spec/support/models/active_record/query.rb
255
257
  - spec/support/models/active_record/shipping_address.rb
256
258
  - spec/support/models/customer.rb
257
259
  - spec/support/models/empty_class.rb
@@ -260,10 +262,11 @@ files:
260
262
  - spec/support/models/person.rb
261
263
  - spec/support/models/player.rb
262
264
  - spec/support/models/shipping_address.rb
265
+ - spec/support/object_id.rb
263
266
  - spec/support/ruby_versions.rb
264
267
  - spec/support/shared_examples/active_record.rb
265
268
  - spec/support/shared_examples/hash_with_indifferent_access.rb
266
- - spec/unit/equality_matcher_spec.rb
269
+ - spec/unit/equality_matchers/main_spec.rb
267
270
  - spec/unit/object_inspection_spec.rb
268
271
  - spec/unit/rspec/matchers/be_compared_to_spec.rb
269
272
  - spec/unit/rspec/matchers/be_falsey_spec.rb
@@ -274,7 +277,9 @@ files:
274
277
  - spec/unit/rspec/matchers/contain_exactly_spec.rb
275
278
  - spec/unit/rspec/matchers/eq_spec.rb
276
279
  - spec/unit/rspec/matchers/have_attributes_spec.rb
280
+ - spec/unit/rspec/matchers/have_predicate_spec.rb
277
281
  - spec/unit/rspec/matchers/include_spec.rb
282
+ - spec/unit/rspec/matchers/match_array_spec.rb
278
283
  - spec/unit/rspec/matchers/match_spec.rb
279
284
  - spec/unit/rspec/matchers/raise_error_spec.rb
280
285
  - spec/unit/rspec/matchers/respond_to_spec.rb
@@ -282,7 +287,7 @@ files:
282
287
  homepage: https://github.com/mcmire/super_diff
283
288
  licenses: []
284
289
  metadata: {}
285
- post_install_message:
290
+ post_install_message:
286
291
  rdoc_options: []
287
292
  require_paths:
288
293
  - lib
@@ -297,23 +302,25 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
302
  - !ruby/object:Gem::Version
298
303
  version: '0'
299
304
  requirements: []
300
- rubygems_version: 3.0.6
301
- signing_key:
305
+ rubygems_version: 3.1.2
306
+ signing_key:
302
307
  specification_version: 4
303
- summary: Diff complex data structures in Ruby, with helpful output.
308
+ summary: A better way to view differences between complex data structures in RSpec.
304
309
  test_files:
305
310
  - spec/spec_helper.rb
311
+ - spec/unit/equality_matchers/main_spec.rb
306
312
  - spec/unit/object_inspection_spec.rb
307
- - spec/unit/equality_matcher_spec.rb
308
313
  - spec/unit/rspec/matchers/contain_exactly_spec.rb
309
314
  - spec/unit/rspec/matchers/be_predicate_spec.rb
310
315
  - spec/unit/rspec/matchers/raise_error_spec.rb
316
+ - spec/unit/rspec/matchers/have_predicate_spec.rb
311
317
  - spec/unit/rspec/matchers/eq_spec.rb
312
318
  - spec/unit/rspec/matchers/have_attributes_spec.rb
313
319
  - spec/unit/rspec/matchers/match_spec.rb
314
320
  - spec/unit/rspec/matchers/be_spec.rb
315
321
  - spec/unit/rspec/matchers/be_compared_to_spec.rb
316
322
  - spec/unit/rspec/matchers/respond_to_spec.rb
323
+ - spec/unit/rspec/matchers/match_array_spec.rb
317
324
  - spec/unit/rspec/matchers/be_nil_spec.rb
318
325
  - spec/unit/rspec/matchers/be_falsey_spec.rb
319
326
  - spec/unit/rspec/matchers/be_truthy_spec.rb
@@ -327,14 +334,23 @@ test_files:
327
334
  - spec/integration/rspec/be_matcher_spec.rb
328
335
  - spec/integration/rspec/respond_to_matcher_spec.rb
329
336
  - spec/integration/rspec/match_matcher_spec.rb
337
+ - spec/integration/rspec/match_array_matcher_spec.rb
338
+ - spec/integration/rspec/third_party_matcher_spec.rb
330
339
  - spec/integration/rspec/have_attributes_matcher_spec.rb
331
340
  - spec/integration/rspec/raise_error_matcher_spec.rb
332
341
  - spec/integration/rspec/eq_matcher_spec.rb
342
+ - spec/integration/rspec/have_predicate_matcher_spec.rb
333
343
  - spec/integration/rspec/contain_exactly_matcher_spec.rb
334
344
  - spec/integration/rspec/include_matcher_spec.rb
335
345
  - spec/integration/rails/active_record_spec.rb
336
346
  - spec/integration/rails/hash_with_indifferent_access_spec.rb
347
+ - spec/support/object_id.rb
348
+ - spec/support/integration/test_programs/base.rb
349
+ - spec/support/integration/test_programs/rspec_rails.rb
350
+ - spec/support/integration/test_programs/plain.rb
351
+ - spec/support/integration/test_programs/rspec_active_record.rb
337
352
  - spec/support/integration/helpers.rb
353
+ - spec/support/integration/matchers.rb
338
354
  - spec/support/integration/matchers/produce_output_when_run_matcher.rb
339
355
  - spec/support/models/item.rb
340
356
  - spec/support/models/customer.rb
@@ -342,6 +358,7 @@ test_files:
342
358
  - spec/support/models/player.rb
343
359
  - spec/support/models/active_record/shipping_address.rb
344
360
  - spec/support/models/active_record/person.rb
361
+ - spec/support/models/active_record/query.rb
345
362
  - spec/support/models/a.rb
346
363
  - spec/support/models/shipping_address.rb
347
364
  - spec/support/models/order.rb
@@ -1,18 +0,0 @@
1
- module SuperDiff
2
- module ActiveRecord
3
- module ObjectInspection
4
- module MapExtension
5
- def call(object)
6
- case object
7
- when ::ActiveRecord::Base
8
- Inspectors::ActiveRecordModel
9
- when ::ActiveRecord::Relation
10
- Inspectors::ActiveRecordRelation
11
- else
12
- super
13
- end
14
- end
15
- end
16
- end
17
- end
18
- end