super_diff 0.4.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +64 -24
  3. data/lib/super_diff.rb +20 -17
  4. data/lib/super_diff/active_record.rb +20 -24
  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/object_inspection/inspectors/active_record_model.rb +32 -22
  8. data/lib/super_diff/active_record/object_inspection/inspectors/active_record_relation.rb +17 -7
  9. data/lib/super_diff/active_record/operation_tree_builders.rb +14 -0
  10. data/lib/super_diff/active_record/{operational_sequencers → operation_tree_builders}/active_record_model.rb +2 -2
  11. data/lib/super_diff/active_record/{operational_sequencers → operation_tree_builders}/active_record_relation.rb +4 -4
  12. data/lib/super_diff/active_record/{operation_sequences.rb → operation_trees.rb} +2 -2
  13. data/lib/super_diff/active_record/{operation_sequences → operation_trees}/active_record_relation.rb +2 -2
  14. data/lib/super_diff/active_support.rb +16 -19
  15. data/lib/super_diff/active_support/diff_formatters/hash_with_indifferent_access.rb +3 -3
  16. data/lib/super_diff/active_support/differs/hash_with_indifferent_access.rb +3 -5
  17. data/lib/super_diff/active_support/object_inspection/inspectors/hash_with_indifferent_access.rb +17 -7
  18. data/lib/super_diff/active_support/operation_tree_builders.rb +10 -0
  19. data/lib/super_diff/active_support/{operational_sequencers → operation_tree_builders}/hash_with_indifferent_access.rb +2 -2
  20. data/lib/super_diff/active_support/{operation_sequences.rb → operation_trees.rb} +2 -2
  21. data/lib/super_diff/active_support/{operation_sequences → operation_trees}/hash_with_indifferent_access.rb +2 -2
  22. data/lib/super_diff/colorized_document_extensions.rb +4 -4
  23. data/lib/super_diff/configuration.rb +70 -0
  24. data/lib/super_diff/csi.rb +2 -1
  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 +3 -3
  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 +7 -7
  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 +3 -9
  47. data/lib/super_diff/equality_matchers/base.rb +1 -1
  48. data/lib/super_diff/equality_matchers/default.rb +3 -9
  49. data/lib/super_diff/equality_matchers/defaults.rb +12 -0
  50. data/lib/super_diff/equality_matchers/hash.rb +3 -9
  51. data/lib/super_diff/equality_matchers/main.rb +21 -0
  52. data/lib/super_diff/equality_matchers/multiline_string.rb +3 -9
  53. data/lib/super_diff/equality_matchers/primitive.rb +2 -2
  54. data/lib/super_diff/equality_matchers/singleline_string.rb +2 -2
  55. data/lib/super_diff/errors.rb +16 -0
  56. data/lib/super_diff/errors/no_diff_formatter_available_error.rb +21 -0
  57. data/lib/super_diff/errors/no_differ_available_error.rb +24 -0
  58. data/lib/super_diff/errors/no_operational_sequencer_available_error.rb +22 -0
  59. data/lib/super_diff/gem_version.rb +45 -0
  60. data/lib/super_diff/implementation_checks.rb +19 -0
  61. data/lib/super_diff/object_inspection.rb +1 -10
  62. data/lib/super_diff/object_inspection/inspection_tree.rb +6 -2
  63. data/lib/super_diff/object_inspection/inspectors.rb +5 -1
  64. data/lib/super_diff/object_inspection/inspectors/array.rb +20 -10
  65. data/lib/super_diff/object_inspection/inspectors/base.rb +36 -0
  66. data/lib/super_diff/object_inspection/inspectors/custom_object.rb +24 -14
  67. data/lib/super_diff/object_inspection/inspectors/default_object.rb +44 -30
  68. data/lib/super_diff/object_inspection/inspectors/defaults.rb +15 -0
  69. data/lib/super_diff/object_inspection/inspectors/hash.rb +20 -10
  70. data/lib/super_diff/object_inspection/inspectors/main.rb +35 -0
  71. data/lib/super_diff/object_inspection/inspectors/primitive.rb +20 -5
  72. data/lib/super_diff/object_inspection/inspectors/string.rb +15 -5
  73. data/lib/super_diff/object_inspection/inspectors/time_like.rb +23 -0
  74. data/lib/super_diff/object_inspection/nodes/inspection.rb +9 -2
  75. data/lib/super_diff/operation_tree_builders.rb +18 -0
  76. data/lib/super_diff/{operational_sequencers → operation_tree_builders}/array.rb +38 -59
  77. data/lib/super_diff/operation_tree_builders/base.rb +98 -0
  78. data/lib/super_diff/{operational_sequencers → operation_tree_builders}/custom_object.rb +3 -3
  79. data/lib/super_diff/{operational_sequencers → operation_tree_builders}/default_object.rb +8 -3
  80. data/lib/super_diff/operation_tree_builders/defaults.rb +5 -0
  81. data/lib/super_diff/operation_tree_builders/hash.rb +226 -0
  82. data/lib/super_diff/operation_tree_builders/main.rb +42 -0
  83. data/lib/super_diff/{operational_sequencers → operation_tree_builders}/multiline_string.rb +3 -3
  84. data/lib/super_diff/operation_tree_builders/time_like.rb +34 -0
  85. data/lib/super_diff/operation_trees.rb +13 -0
  86. data/lib/super_diff/{operation_sequences → operation_trees}/array.rb +5 -1
  87. data/lib/super_diff/{operation_sequences → operation_trees}/base.rb +9 -1
  88. data/lib/super_diff/{operation_sequences → operation_trees}/custom_object.rb +5 -1
  89. data/lib/super_diff/{operation_sequences → operation_trees}/default_object.rb +10 -8
  90. data/lib/super_diff/operation_trees/defaults.rb +5 -0
  91. data/lib/super_diff/{operation_sequences → operation_trees}/hash.rb +5 -1
  92. data/lib/super_diff/operation_trees/main.rb +35 -0
  93. data/lib/super_diff/operation_trees/multiline_string.rb +18 -0
  94. data/lib/super_diff/operations/unary_operation.rb +3 -0
  95. data/lib/super_diff/recursion_guard.rb +2 -0
  96. data/lib/super_diff/rspec.rb +49 -13
  97. data/lib/super_diff/rspec/augmented_matcher.rb +1 -1
  98. data/lib/super_diff/rspec/differ.rb +2 -17
  99. data/lib/super_diff/rspec/differs/collection_containing_exactly.rb +2 -7
  100. data/lib/super_diff/rspec/differs/collection_including.rb +2 -7
  101. data/lib/super_diff/rspec/differs/hash_including.rb +2 -7
  102. data/lib/super_diff/rspec/differs/object_having_attributes.rb +2 -7
  103. data/lib/super_diff/rspec/matcher_text_builders/base.rb +7 -7
  104. data/lib/super_diff/rspec/matcher_text_builders/be_predicate.rb +6 -6
  105. data/lib/super_diff/rspec/matcher_text_builders/contain_exactly.rb +1 -1
  106. data/lib/super_diff/rspec/matcher_text_builders/have_predicate.rb +4 -4
  107. data/lib/super_diff/rspec/matcher_text_builders/match.rb +1 -1
  108. data/lib/super_diff/rspec/matcher_text_builders/raise_error.rb +1 -1
  109. data/lib/super_diff/rspec/matcher_text_builders/respond_to.rb +6 -6
  110. data/lib/super_diff/rspec/matcher_text_template.rb +1 -1
  111. data/lib/super_diff/rspec/monkey_patches.rb +23 -14
  112. data/lib/super_diff/rspec/object_inspection.rb +0 -1
  113. data/lib/super_diff/rspec/object_inspection/inspectors.rb +16 -0
  114. data/lib/super_diff/rspec/object_inspection/inspectors/collection_containing_exactly.rb +17 -8
  115. data/lib/super_diff/rspec/object_inspection/inspectors/collection_including.rb +15 -9
  116. data/lib/super_diff/rspec/object_inspection/inspectors/hash_including.rb +20 -10
  117. data/lib/super_diff/rspec/object_inspection/inspectors/instance_of.rb +23 -0
  118. data/lib/super_diff/rspec/object_inspection/inspectors/kind_of.rb +23 -0
  119. data/lib/super_diff/rspec/object_inspection/inspectors/object_having_attributes.rb +20 -11
  120. data/lib/super_diff/rspec/object_inspection/inspectors/primitive.rb +13 -0
  121. data/lib/super_diff/rspec/object_inspection/inspectors/value_within.rb +29 -0
  122. data/lib/super_diff/rspec/operation_tree_builders.rb +22 -0
  123. data/lib/super_diff/rspec/{operational_sequencers → operation_tree_builders}/collection_containing_exactly.rb +17 -6
  124. data/lib/super_diff/rspec/{operational_sequencers → operation_tree_builders}/collection_including.rb +2 -2
  125. data/lib/super_diff/rspec/{operational_sequencers → operation_tree_builders}/hash_including.rb +3 -11
  126. data/lib/super_diff/rspec/{operational_sequencers → operation_tree_builders}/object_having_attributes.rb +4 -8
  127. data/lib/super_diff/version.rb +1 -1
  128. data/spec/examples.txt +393 -393
  129. data/spec/integration/rspec/be_falsey_matcher_spec.rb +10 -10
  130. data/spec/integration/rspec/be_matcher_spec.rb +100 -100
  131. data/spec/integration/rspec/be_nil_matcher_spec.rb +10 -10
  132. data/spec/integration/rspec/be_predicate_matcher_spec.rb +103 -103
  133. data/spec/integration/rspec/be_truthy_matcher_spec.rb +10 -10
  134. data/spec/integration/rspec/contain_exactly_matcher_spec.rb +107 -107
  135. data/spec/integration/rspec/eq_matcher_spec.rb +230 -230
  136. data/spec/integration/rspec/have_attributes_matcher_spec.rb +360 -233
  137. data/spec/integration/rspec/have_predicate_matcher_spec.rb +65 -65
  138. data/spec/integration/rspec/include_matcher_spec.rb +73 -73
  139. data/spec/integration/rspec/match_array_matcher_spec.rb +149 -107
  140. data/spec/integration/rspec/match_matcher_spec.rb +274 -274
  141. data/spec/integration/rspec/raise_error_matcher_spec.rb +86 -86
  142. data/spec/integration/rspec/respond_to_matcher_spec.rb +240 -240
  143. data/spec/integration/rspec/third_party_matcher_spec.rb +8 -8
  144. data/spec/integration/rspec/unhandled_errors_spec.rb +69 -13
  145. data/spec/spec_helper.rb +22 -13
  146. data/spec/support/command_runner.rb +3 -0
  147. data/spec/support/integration/helpers.rb +15 -95
  148. data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +15 -30
  149. data/spec/support/integration/test_programs/base.rb +122 -0
  150. data/spec/support/integration/test_programs/plain.rb +13 -0
  151. data/spec/support/integration/test_programs/rspec_active_record.rb +17 -0
  152. data/spec/support/integration/test_programs/rspec_active_support.rb +17 -0
  153. data/spec/support/integration/test_programs/rspec_rails.rb +17 -0
  154. data/spec/support/models/active_record/person.rb +4 -11
  155. data/spec/support/models/active_record/shipping_address.rb +10 -14
  156. data/spec/support/object_id.rb +6 -5
  157. data/spec/support/shared_examples/active_record.rb +108 -108
  158. data/spec/support/shared_examples/hash_with_indifferent_access.rb +196 -232
  159. data/spec/tmp/integration_spec.rb +15 -0
  160. data/spec/unit/{equality_matcher_spec.rb → equality_matchers/main_spec.rb} +518 -362
  161. data/spec/unit/object_inspection_spec.rb +77 -1
  162. data/super_diff.gemspec +3 -2
  163. metadata +83 -54
  164. data/lib/super_diff/active_record/object_inspection/map_extension.rb +0 -18
  165. data/lib/super_diff/active_record/operational_sequencers.rb +0 -14
  166. data/lib/super_diff/active_support/object_inspection/map_extension.rb +0 -15
  167. data/lib/super_diff/active_support/operational_sequencers.rb +0 -10
  168. data/lib/super_diff/diff_formatter.rb +0 -32
  169. data/lib/super_diff/differ.rb +0 -51
  170. data/lib/super_diff/differs/time.rb +0 -24
  171. data/lib/super_diff/equality_matcher.rb +0 -32
  172. data/lib/super_diff/no_differ_available_error.rb +0 -22
  173. data/lib/super_diff/no_operational_sequencer_available_error.rb +0 -20
  174. data/lib/super_diff/object_inspection/inspector.rb +0 -27
  175. data/lib/super_diff/object_inspection/inspectors/time.rb +0 -13
  176. data/lib/super_diff/object_inspection/map.rb +0 -30
  177. data/lib/super_diff/operation_sequences.rb +0 -9
  178. data/lib/super_diff/operational_sequencer.rb +0 -48
  179. data/lib/super_diff/operational_sequencers.rb +0 -17
  180. data/lib/super_diff/operational_sequencers/base.rb +0 -89
  181. data/lib/super_diff/operational_sequencers/hash.rb +0 -85
  182. data/lib/super_diff/operational_sequencers/time_like.rb +0 -30
  183. data/lib/super_diff/rspec/configuration.rb +0 -31
  184. data/lib/super_diff/rspec/object_inspection/map_extension.rb +0 -23
  185. data/lib/super_diff/rspec/operational_sequencers.rb +0 -22
@@ -601,7 +601,7 @@ RSpec.describe SuperDiff::ObjectInspection do
601
601
  as_single_line: false,
602
602
  )
603
603
  expect(inspection).to match(
604
- /#<SuperDiff::Test::EmptyClass:0x[a-z0-9]+>/
604
+ /#<SuperDiff::Test::EmptyClass:0x[a-z0-9]+>/,
605
605
  )
606
606
  end
607
607
  end
@@ -734,6 +734,82 @@ RSpec.describe SuperDiff::ObjectInspection do
734
734
  end
735
735
  end
736
736
 
737
+ context "given a kind-of-<something>" do
738
+ context "given as_single_line: true" do
739
+ it "returns a representation of the object on a single line" do
740
+ inspection = described_class.inspect(
741
+ a_kind_of(Symbol),
742
+ as_single_line: true,
743
+ )
744
+
745
+ expect(inspection).to eq(%(#<a kind of Symbol>))
746
+ end
747
+ end
748
+
749
+ context "given as_single_line: false" do
750
+ it "returns a representation of the object on a single line" do
751
+ inspection = described_class.inspect(
752
+ a_kind_of(Symbol),
753
+ as_single_line: false,
754
+ )
755
+
756
+ expect(inspection).to eq(%(#<a kind of Symbol>))
757
+ end
758
+ end
759
+ end
760
+
761
+ context "given an-instance-of-<something>" do
762
+ context "given as_single_line: true" do
763
+ it "returns a representation of the object on a single line" do
764
+ inspection = described_class.inspect(
765
+ an_instance_of(Symbol),
766
+ as_single_line: true,
767
+ )
768
+
769
+ expect(inspection).to eq(%(#<an instance of Symbol>))
770
+ end
771
+ end
772
+
773
+ context "given as_single_line: false" do
774
+ it "returns a representation of the object on a single line" do
775
+ inspection = described_class.inspect(
776
+ an_instance_of(Symbol),
777
+ as_single_line: false,
778
+ )
779
+
780
+ expect(inspection).to eq(%(#<an instance of Symbol>))
781
+ end
782
+ end
783
+ end
784
+
785
+ context "given a-value-within-<something>" do
786
+ context "given as_single_line: true" do
787
+ it "returns a representation of the object on a single line" do
788
+ inspection = described_class.inspect(
789
+ a_value_within(1).of(Time.utc(2020, 4, 9)),
790
+ as_single_line: true,
791
+ )
792
+
793
+ expect(inspection).to eq(
794
+ %(#<a value within 1 of 2020-04-09 00:00:00.000 UTC +00:00 (Time)>),
795
+ )
796
+ end
797
+ end
798
+
799
+ context "given as_single_line: false" do
800
+ it "returns a representation of the object on a single line" do
801
+ inspection = described_class.inspect(
802
+ a_value_within(1).of(Time.utc(2020, 4, 9)),
803
+ as_single_line: false,
804
+ )
805
+
806
+ expect(inspection).to eq(
807
+ %(#<a value within 1 of 2020-04-09 00:00:00.000 UTC +00:00 (Time)>),
808
+ )
809
+ end
810
+ end
811
+ end
812
+
737
813
  context "given a Double" do
738
814
  context "that is anonymous" do
739
815
  context "given as_single_line: true" do
data/super_diff.gemspec CHANGED
@@ -7,17 +7,18 @@ Gem::Specification.new do |s|
7
7
  s.email = ["elliot.winkler@gmail.com"]
8
8
  s.homepage = "https://github.com/mcmire/super_diff"
9
9
  s.summary = "A better way to view differences between complex data structures in RSpec."
10
+ s.license = "MIT"
10
11
  s.description = <<~DESC
11
12
  SuperDiff is a gem that hooks into RSpec to intelligently display the
12
13
  differences between two data structures of any type.
13
14
  DESC
14
- s.required_ruby_version = "~> 2.4"
15
+ s.required_ruby_version = [">= 2.4", "< 4"]
15
16
 
16
17
  s.files = ["README.md", "super_diff.gemspec"] + Dir["lib/**/*"]
17
18
  s.test_files = Dir["spec/**/*"]
18
19
  s.executables = Dir["exe/**/*"].map { |f| File.basename(f) }
19
20
 
20
- s.add_dependency "attr_extras"
21
+ s.add_dependency "attr_extras", '>= 6.2.4'
21
22
  s.add_dependency "diff-lcs"
22
23
  s.add_dependency "patience_diff"
23
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.6.0
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: 2020-02-12 00:00:00.000000000 Z
11
+ date: 2021-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attr_extras
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 6.2.4
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'
26
+ version: 6.2.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: diff-lcs
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -73,12 +73,11 @@ files:
73
73
  - lib/super_diff/active_record/object_inspection/inspectors.rb
74
74
  - lib/super_diff/active_record/object_inspection/inspectors/active_record_model.rb
75
75
  - lib/super_diff/active_record/object_inspection/inspectors/active_record_relation.rb
76
- - lib/super_diff/active_record/object_inspection/map_extension.rb
77
- - lib/super_diff/active_record/operation_sequences.rb
78
- - lib/super_diff/active_record/operation_sequences/active_record_relation.rb
79
- - lib/super_diff/active_record/operational_sequencers.rb
80
- - lib/super_diff/active_record/operational_sequencers/active_record_model.rb
81
- - 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
82
81
  - lib/super_diff/active_support.rb
83
82
  - lib/super_diff/active_support/diff_formatters.rb
84
83
  - lib/super_diff/active_support/diff_formatters/hash_with_indifferent_access.rb
@@ -87,12 +86,12 @@ files:
87
86
  - lib/super_diff/active_support/object_inspection.rb
88
87
  - lib/super_diff/active_support/object_inspection/inspectors.rb
89
88
  - lib/super_diff/active_support/object_inspection/inspectors/hash_with_indifferent_access.rb
90
- - lib/super_diff/active_support/object_inspection/map_extension.rb
91
- - lib/super_diff/active_support/operation_sequences.rb
92
- - lib/super_diff/active_support/operation_sequences/hash_with_indifferent_access.rb
93
- - lib/super_diff/active_support/operational_sequencers.rb
94
- - 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
95
93
  - lib/super_diff/colorized_document_extensions.rb
94
+ - lib/super_diff/configuration.rb
96
95
  - lib/super_diff/csi.rb
97
96
  - lib/super_diff/csi/bold_sequence.rb
98
97
  - lib/super_diff/csi/color.rb
@@ -104,49 +103,57 @@ files:
104
103
  - lib/super_diff/csi/reset_sequence.rb
105
104
  - lib/super_diff/csi/twenty_four_bit_color.rb
106
105
  - lib/super_diff/csi/uncolorized_document.rb
107
- - lib/super_diff/diff_formatter.rb
108
106
  - lib/super_diff/diff_formatters.rb
109
107
  - lib/super_diff/diff_formatters/array.rb
110
108
  - lib/super_diff/diff_formatters/base.rb
111
109
  - lib/super_diff/diff_formatters/collection.rb
112
110
  - lib/super_diff/diff_formatters/custom_object.rb
113
111
  - lib/super_diff/diff_formatters/default_object.rb
112
+ - lib/super_diff/diff_formatters/defaults.rb
114
113
  - lib/super_diff/diff_formatters/hash.rb
114
+ - lib/super_diff/diff_formatters/main.rb
115
115
  - lib/super_diff/diff_formatters/multiline_string.rb
116
- - lib/super_diff/differ.rb
117
116
  - lib/super_diff/differs.rb
118
117
  - lib/super_diff/differs/array.rb
119
118
  - lib/super_diff/differs/base.rb
120
119
  - lib/super_diff/differs/custom_object.rb
121
120
  - lib/super_diff/differs/default_object.rb
121
+ - lib/super_diff/differs/defaults.rb
122
122
  - lib/super_diff/differs/empty.rb
123
123
  - lib/super_diff/differs/hash.rb
124
+ - lib/super_diff/differs/main.rb
124
125
  - lib/super_diff/differs/multiline_string.rb
125
- - lib/super_diff/differs/time.rb
126
- - lib/super_diff/equality_matcher.rb
126
+ - lib/super_diff/differs/time_like.rb
127
127
  - lib/super_diff/equality_matchers.rb
128
128
  - lib/super_diff/equality_matchers/array.rb
129
129
  - lib/super_diff/equality_matchers/base.rb
130
130
  - lib/super_diff/equality_matchers/default.rb
131
+ - lib/super_diff/equality_matchers/defaults.rb
131
132
  - lib/super_diff/equality_matchers/hash.rb
133
+ - lib/super_diff/equality_matchers/main.rb
132
134
  - lib/super_diff/equality_matchers/multiline_string.rb
133
135
  - lib/super_diff/equality_matchers/primitive.rb
134
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
141
+ - lib/super_diff/gem_version.rb
135
142
  - lib/super_diff/helpers.rb
136
- - lib/super_diff/no_differ_available_error.rb
137
- - lib/super_diff/no_operational_sequencer_available_error.rb
143
+ - lib/super_diff/implementation_checks.rb
138
144
  - lib/super_diff/object_inspection.rb
139
145
  - lib/super_diff/object_inspection/inspection_tree.rb
140
- - lib/super_diff/object_inspection/inspector.rb
141
146
  - lib/super_diff/object_inspection/inspectors.rb
142
147
  - lib/super_diff/object_inspection/inspectors/array.rb
148
+ - lib/super_diff/object_inspection/inspectors/base.rb
143
149
  - lib/super_diff/object_inspection/inspectors/custom_object.rb
144
150
  - lib/super_diff/object_inspection/inspectors/default_object.rb
151
+ - lib/super_diff/object_inspection/inspectors/defaults.rb
145
152
  - lib/super_diff/object_inspection/inspectors/hash.rb
153
+ - lib/super_diff/object_inspection/inspectors/main.rb
146
154
  - lib/super_diff/object_inspection/inspectors/primitive.rb
147
155
  - lib/super_diff/object_inspection/inspectors/string.rb
148
- - lib/super_diff/object_inspection/inspectors/time.rb
149
- - lib/super_diff/object_inspection/map.rb
156
+ - lib/super_diff/object_inspection/inspectors/time_like.rb
150
157
  - lib/super_diff/object_inspection/nodes.rb
151
158
  - lib/super_diff/object_inspection/nodes/base.rb
152
159
  - lib/super_diff/object_inspection/nodes/break.rb
@@ -157,21 +164,25 @@ files:
157
164
  - lib/super_diff/object_inspection/nodes/when_multiline.rb
158
165
  - lib/super_diff/object_inspection/nodes/when_non_empty.rb
159
166
  - lib/super_diff/object_inspection/nodes/when_singleline.rb
160
- - lib/super_diff/operation_sequences.rb
161
- - lib/super_diff/operation_sequences/array.rb
162
- - lib/super_diff/operation_sequences/base.rb
163
- - lib/super_diff/operation_sequences/custom_object.rb
164
- - lib/super_diff/operation_sequences/default_object.rb
165
- - lib/super_diff/operation_sequences/hash.rb
166
- - lib/super_diff/operational_sequencer.rb
167
- - lib/super_diff/operational_sequencers.rb
168
- - lib/super_diff/operational_sequencers/array.rb
169
- - lib/super_diff/operational_sequencers/base.rb
170
- - lib/super_diff/operational_sequencers/custom_object.rb
171
- - lib/super_diff/operational_sequencers/default_object.rb
172
- - lib/super_diff/operational_sequencers/hash.rb
173
- - lib/super_diff/operational_sequencers/multiline_string.rb
174
- - lib/super_diff/operational_sequencers/time_like.rb
167
+ - lib/super_diff/operation_tree_builders.rb
168
+ - lib/super_diff/operation_tree_builders/array.rb
169
+ - lib/super_diff/operation_tree_builders/base.rb
170
+ - lib/super_diff/operation_tree_builders/custom_object.rb
171
+ - lib/super_diff/operation_tree_builders/default_object.rb
172
+ - lib/super_diff/operation_tree_builders/defaults.rb
173
+ - lib/super_diff/operation_tree_builders/hash.rb
174
+ - lib/super_diff/operation_tree_builders/main.rb
175
+ - lib/super_diff/operation_tree_builders/multiline_string.rb
176
+ - lib/super_diff/operation_tree_builders/time_like.rb
177
+ - lib/super_diff/operation_trees.rb
178
+ - lib/super_diff/operation_trees/array.rb
179
+ - lib/super_diff/operation_trees/base.rb
180
+ - lib/super_diff/operation_trees/custom_object.rb
181
+ - lib/super_diff/operation_trees/default_object.rb
182
+ - lib/super_diff/operation_trees/defaults.rb
183
+ - lib/super_diff/operation_trees/hash.rb
184
+ - lib/super_diff/operation_trees/main.rb
185
+ - lib/super_diff/operation_trees/multiline_string.rb
175
186
  - lib/super_diff/operations.rb
176
187
  - lib/super_diff/operations/binary_operation.rb
177
188
  - lib/super_diff/operations/unary_operation.rb
@@ -180,7 +191,6 @@ files:
180
191
  - lib/super_diff/rspec-rails.rb
181
192
  - lib/super_diff/rspec.rb
182
193
  - lib/super_diff/rspec/augmented_matcher.rb
183
- - lib/super_diff/rspec/configuration.rb
184
194
  - lib/super_diff/rspec/differ.rb
185
195
  - lib/super_diff/rspec/differs.rb
186
196
  - lib/super_diff/rspec/differs/collection_containing_exactly.rb
@@ -202,13 +212,16 @@ files:
202
212
  - lib/super_diff/rspec/object_inspection/inspectors/collection_containing_exactly.rb
203
213
  - lib/super_diff/rspec/object_inspection/inspectors/collection_including.rb
204
214
  - lib/super_diff/rspec/object_inspection/inspectors/hash_including.rb
215
+ - lib/super_diff/rspec/object_inspection/inspectors/instance_of.rb
216
+ - lib/super_diff/rspec/object_inspection/inspectors/kind_of.rb
205
217
  - lib/super_diff/rspec/object_inspection/inspectors/object_having_attributes.rb
206
- - lib/super_diff/rspec/object_inspection/map_extension.rb
207
- - lib/super_diff/rspec/operational_sequencers.rb
208
- - lib/super_diff/rspec/operational_sequencers/collection_containing_exactly.rb
209
- - lib/super_diff/rspec/operational_sequencers/collection_including.rb
210
- - lib/super_diff/rspec/operational_sequencers/hash_including.rb
211
- - lib/super_diff/rspec/operational_sequencers/object_having_attributes.rb
218
+ - lib/super_diff/rspec/object_inspection/inspectors/primitive.rb
219
+ - lib/super_diff/rspec/object_inspection/inspectors/value_within.rb
220
+ - lib/super_diff/rspec/operation_tree_builders.rb
221
+ - lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb
222
+ - lib/super_diff/rspec/operation_tree_builders/collection_including.rb
223
+ - lib/super_diff/rspec/operation_tree_builders/hash_including.rb
224
+ - lib/super_diff/rspec/operation_tree_builders/object_having_attributes.rb
212
225
  - lib/super_diff/version.rb
213
226
  - spec/examples.txt
214
227
  - spec/integration/rails/active_record_spec.rb
@@ -235,6 +248,11 @@ files:
235
248
  - spec/support/integration/helpers.rb
236
249
  - spec/support/integration/matchers.rb
237
250
  - spec/support/integration/matchers/produce_output_when_run_matcher.rb
251
+ - spec/support/integration/test_programs/base.rb
252
+ - spec/support/integration/test_programs/plain.rb
253
+ - spec/support/integration/test_programs/rspec_active_record.rb
254
+ - spec/support/integration/test_programs/rspec_active_support.rb
255
+ - spec/support/integration/test_programs/rspec_rails.rb
238
256
  - spec/support/models/a.rb
239
257
  - spec/support/models/active_record/person.rb
240
258
  - spec/support/models/active_record/query.rb
@@ -250,7 +268,8 @@ files:
250
268
  - spec/support/ruby_versions.rb
251
269
  - spec/support/shared_examples/active_record.rb
252
270
  - spec/support/shared_examples/hash_with_indifferent_access.rb
253
- - spec/unit/equality_matcher_spec.rb
271
+ - spec/tmp/integration_spec.rb
272
+ - spec/unit/equality_matchers/main_spec.rb
254
273
  - spec/unit/object_inspection_spec.rb
255
274
  - spec/unit/rspec/matchers/be_compared_to_spec.rb
256
275
  - spec/unit/rspec/matchers/be_falsey_spec.rb
@@ -269,31 +288,35 @@ files:
269
288
  - spec/unit/rspec/matchers/respond_to_spec.rb
270
289
  - super_diff.gemspec
271
290
  homepage: https://github.com/mcmire/super_diff
272
- licenses: []
291
+ licenses:
292
+ - MIT
273
293
  metadata: {}
274
- post_install_message:
294
+ post_install_message:
275
295
  rdoc_options: []
276
296
  require_paths:
277
297
  - lib
278
298
  required_ruby_version: !ruby/object:Gem::Requirement
279
299
  requirements:
280
- - - "~>"
300
+ - - ">="
281
301
  - !ruby/object:Gem::Version
282
302
  version: '2.4'
303
+ - - "<"
304
+ - !ruby/object:Gem::Version
305
+ version: '4'
283
306
  required_rubygems_version: !ruby/object:Gem::Requirement
284
307
  requirements:
285
308
  - - ">="
286
309
  - !ruby/object:Gem::Version
287
310
  version: '0'
288
311
  requirements: []
289
- rubygems_version: 3.0.6
290
- signing_key:
312
+ rubygems_version: 3.1.2
313
+ signing_key:
291
314
  specification_version: 4
292
315
  summary: A better way to view differences between complex data structures in RSpec.
293
316
  test_files:
294
317
  - spec/spec_helper.rb
318
+ - spec/unit/equality_matchers/main_spec.rb
295
319
  - spec/unit/object_inspection_spec.rb
296
- - spec/unit/equality_matcher_spec.rb
297
320
  - spec/unit/rspec/matchers/contain_exactly_spec.rb
298
321
  - spec/unit/rspec/matchers/be_predicate_spec.rb
299
322
  - spec/unit/rspec/matchers/raise_error_spec.rb
@@ -329,6 +352,11 @@ test_files:
329
352
  - spec/integration/rails/active_record_spec.rb
330
353
  - spec/integration/rails/hash_with_indifferent_access_spec.rb
331
354
  - spec/support/object_id.rb
355
+ - spec/support/integration/test_programs/base.rb
356
+ - spec/support/integration/test_programs/rspec_rails.rb
357
+ - spec/support/integration/test_programs/plain.rb
358
+ - spec/support/integration/test_programs/rspec_active_support.rb
359
+ - spec/support/integration/test_programs/rspec_active_record.rb
332
360
  - spec/support/integration/helpers.rb
333
361
  - spec/support/integration/matchers.rb
334
362
  - spec/support/integration/matchers/produce_output_when_run_matcher.rb
@@ -348,3 +376,4 @@ test_files:
348
376
  - spec/support/colorizer.rb
349
377
  - spec/support/shared_examples/hash_with_indifferent_access.rb
350
378
  - spec/support/shared_examples/active_record.rb
379
+ - spec/tmp/integration_spec.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
@@ -1,14 +0,0 @@
1
- module SuperDiff
2
- module ActiveRecord
3
- module OperationalSequencers
4
- autoload(
5
- :ActiveRecordModel,
6
- "super_diff/active_record/operational_sequencers/active_record_model",
7
- )
8
- autoload(
9
- :ActiveRecordRelation,
10
- "super_diff/active_record/operational_sequencers/active_record_relation",
11
- )
12
- end
13
- end
14
- end
@@ -1,15 +0,0 @@
1
- module SuperDiff
2
- module ActiveSupport
3
- module ObjectInspection
4
- module MapExtension
5
- def call(object)
6
- if object.is_a?(::HashWithIndifferentAccess)
7
- Inspectors::HashWithIndifferentAccess
8
- else
9
- super
10
- end
11
- end
12
- end
13
- end
14
- end
15
- end