super_diff 0.5.3 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +46 -20
- data/lib/super_diff.rb +46 -7
- data/lib/super_diff/active_record.rb +7 -7
- data/lib/super_diff/active_record/differs/active_record_relation.rb +3 -13
- data/lib/super_diff/active_record/object_inspection.rb +2 -6
- data/lib/super_diff/active_record/object_inspection/inspection_tree_builders.rb +16 -0
- data/lib/super_diff/active_record/object_inspection/{inspectors → inspection_tree_builders}/active_record_model.rb +19 -20
- data/lib/super_diff/active_record/object_inspection/{inspectors → inspection_tree_builders}/active_record_relation.rb +9 -8
- data/lib/super_diff/active_record/operation_tree_flatteners.rb +10 -0
- data/lib/super_diff/active_record/operation_tree_flatteners/active_record_relation.rb +17 -0
- data/lib/super_diff/active_record/operation_trees/active_record_relation.rb +8 -7
- data/lib/super_diff/active_support.rb +8 -8
- data/lib/super_diff/active_support/differs/hash_with_indifferent_access.rb +3 -13
- data/lib/super_diff/active_support/object_inspection.rb +2 -6
- data/lib/super_diff/active_support/object_inspection/{inspectors.rb → inspection_tree_builders.rb} +2 -2
- data/lib/super_diff/active_support/object_inspection/inspection_tree_builders/hash_with_indifferent_access.rb +37 -0
- data/lib/super_diff/active_support/operation_tree_builders/hash_with_indifferent_access.rb +17 -0
- data/lib/super_diff/active_support/operation_tree_flatteners.rb +10 -0
- data/lib/super_diff/active_support/operation_tree_flatteners/hash_with_indifferent_access.rb +17 -0
- data/lib/super_diff/active_support/operation_trees/hash_with_indifferent_access.rb +4 -7
- data/lib/super_diff/colorized_document_extensions.rb +9 -6
- data/lib/super_diff/configuration.rb +102 -19
- data/lib/super_diff/csi.rb +1 -1
- data/lib/super_diff/csi/four_bit_color.rb +0 -2
- data/lib/super_diff/diff_formatters/collection.rb +2 -2
- data/lib/super_diff/diff_formatters/multiline_string.rb +4 -4
- data/lib/super_diff/differs/array.rb +1 -1
- data/lib/super_diff/differs/base.rb +3 -21
- data/lib/super_diff/differs/custom_object.rb +1 -1
- data/lib/super_diff/differs/default_object.rb +1 -1
- data/lib/super_diff/differs/hash.rb +1 -1
- data/lib/super_diff/differs/main.rb +1 -7
- data/lib/super_diff/differs/multiline_string.rb +1 -1
- data/lib/super_diff/differs/time_like.rb +1 -1
- data/lib/super_diff/equality_matchers/array.rb +4 -4
- data/lib/super_diff/equality_matchers/default.rb +4 -4
- data/lib/super_diff/equality_matchers/hash.rb +4 -4
- data/lib/super_diff/equality_matchers/multiline_string.rb +4 -4
- data/lib/super_diff/equality_matchers/primitive.rb +6 -9
- data/lib/super_diff/equality_matchers/singleline_string.rb +4 -4
- data/lib/super_diff/gem_version.rb +45 -0
- data/lib/super_diff/helpers.rb +52 -2
- data/lib/super_diff/line.rb +83 -0
- data/lib/super_diff/object_inspection.rb +12 -9
- data/lib/super_diff/object_inspection/inspection_tree.rb +183 -81
- data/lib/super_diff/object_inspection/inspection_tree_builders.rb +44 -0
- data/lib/super_diff/object_inspection/inspection_tree_builders/array.rb +38 -0
- data/lib/super_diff/object_inspection/inspection_tree_builders/base.rb +27 -0
- data/lib/super_diff/object_inspection/inspection_tree_builders/custom_object.rb +37 -0
- data/lib/super_diff/object_inspection/inspection_tree_builders/default_object.rb +63 -0
- data/lib/super_diff/object_inspection/{inspectors → inspection_tree_builders}/defaults.rb +1 -2
- data/lib/super_diff/object_inspection/inspection_tree_builders/hash.rb +46 -0
- data/lib/super_diff/object_inspection/{inspectors → inspection_tree_builders}/main.rb +5 -10
- data/lib/super_diff/object_inspection/inspection_tree_builders/primitive.rb +21 -0
- data/lib/super_diff/object_inspection/inspection_tree_builders/time_like.rb +64 -0
- data/lib/super_diff/object_inspection/nodes.rb +33 -32
- data/lib/super_diff/object_inspection/nodes/as_lines_when_rendering_to_lines.rb +97 -0
- data/lib/super_diff/object_inspection/nodes/as_prefix_when_rendering_to_lines.rb +27 -0
- data/lib/super_diff/object_inspection/nodes/as_prelude_when_rendering_to_lines.rb +27 -0
- data/lib/super_diff/object_inspection/nodes/as_single_line.rb +33 -0
- data/lib/super_diff/object_inspection/nodes/base.rb +55 -20
- data/lib/super_diff/object_inspection/nodes/inspection.rb +47 -7
- data/lib/super_diff/object_inspection/nodes/nesting.rb +16 -5
- data/lib/super_diff/object_inspection/nodes/only_when.rb +54 -0
- data/lib/super_diff/object_inspection/nodes/text.rb +16 -2
- data/lib/super_diff/object_inspection/nodes/when_empty.rb +21 -6
- data/lib/super_diff/object_inspection/nodes/when_non_empty.rb +20 -5
- data/lib/super_diff/object_inspection/nodes/when_rendering_to_lines.rb +27 -0
- data/lib/super_diff/object_inspection/nodes/when_rendering_to_string.rb +27 -0
- data/lib/super_diff/object_inspection/prefix_for_next_node.rb +6 -0
- data/lib/super_diff/object_inspection/prelude_for_next_node.rb +6 -0
- data/lib/super_diff/operation_tree_builders/array.rb +7 -10
- data/lib/super_diff/operation_tree_builders/base.rb +6 -6
- data/lib/super_diff/operation_tree_builders/custom_object.rb +5 -2
- data/lib/super_diff/operation_tree_builders/default_object.rb +1 -1
- data/lib/super_diff/operation_tree_builders/defaults.rb +1 -1
- data/lib/super_diff/operation_tree_builders/hash.rb +1 -8
- data/lib/super_diff/operation_tree_builders/multiline_string.rb +2 -6
- data/lib/super_diff/operation_tree_builders/time_like.rb +2 -2
- data/lib/super_diff/operation_tree_flatteners.rb +20 -0
- data/lib/super_diff/operation_tree_flatteners/array.rb +15 -0
- data/lib/super_diff/operation_tree_flatteners/base.rb +54 -0
- data/lib/super_diff/operation_tree_flatteners/collection.rb +139 -0
- data/lib/super_diff/operation_tree_flatteners/custom_object.rb +28 -0
- data/lib/super_diff/operation_tree_flatteners/default_object.rb +32 -0
- data/lib/super_diff/operation_tree_flatteners/hash.rb +41 -0
- data/lib/super_diff/operation_tree_flatteners/multiline_string.rb +17 -0
- data/lib/super_diff/operation_trees/array.rb +4 -7
- data/lib/super_diff/operation_trees/base.rb +39 -16
- data/lib/super_diff/operation_trees/custom_object.rb +4 -8
- data/lib/super_diff/operation_trees/default_object.rb +28 -13
- data/lib/super_diff/operation_trees/hash.rb +4 -7
- data/lib/super_diff/operation_trees/main.rb +1 -1
- data/lib/super_diff/operation_trees/multiline_string.rb +4 -7
- data/lib/super_diff/operations/binary_operation.rb +1 -6
- data/lib/super_diff/operations/unary_operation.rb +2 -30
- data/lib/super_diff/recursion_guard.rb +3 -3
- data/lib/super_diff/rspec.rb +41 -13
- data/lib/super_diff/rspec/differs/collection_including.rb +4 -2
- data/lib/super_diff/rspec/differs/hash_including.rb +4 -2
- data/lib/super_diff/rspec/matcher_text_builders/base.rb +7 -7
- data/lib/super_diff/rspec/matcher_text_builders/be_predicate.rb +6 -6
- data/lib/super_diff/rspec/matcher_text_builders/contain_exactly.rb +1 -1
- data/lib/super_diff/rspec/matcher_text_builders/have_predicate.rb +4 -4
- data/lib/super_diff/rspec/matcher_text_builders/raise_error.rb +1 -1
- data/lib/super_diff/rspec/matcher_text_builders/respond_to.rb +5 -5
- data/lib/super_diff/rspec/monkey_patches.rb +353 -306
- data/lib/super_diff/rspec/object_inspection.rb +4 -1
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders.rb +44 -0
- data/lib/super_diff/rspec/object_inspection/{inspectors → inspection_tree_builders}/collection_containing_exactly.rb +9 -8
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_including.rb +34 -0
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/double.rb +103 -0
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/hash_including.rb +36 -0
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/instance_of.rb +26 -0
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/kind_of.rb +26 -0
- data/lib/super_diff/rspec/object_inspection/{inspectors → inspection_tree_builders}/object_having_attributes.rb +10 -12
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/primitive.rb +10 -0
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/value_within.rb +33 -0
- data/lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb +12 -4
- data/lib/super_diff/rspec/operation_tree_builders/collection_including.rb +10 -3
- data/lib/super_diff/rspec/operation_tree_builders/hash_including.rb +10 -3
- data/lib/super_diff/tiered_lines.rb +4 -0
- data/lib/super_diff/tiered_lines_elider.rb +490 -0
- data/lib/super_diff/tiered_lines_formatter.rb +79 -0
- data/lib/super_diff/version.rb +1 -1
- data/spec/examples.txt +407 -5
- data/spec/integration/rails/active_support_spec.rb +19 -0
- data/spec/integration/rspec/be_falsey_matcher_spec.rb +10 -10
- data/spec/integration/rspec/be_matcher_spec.rb +100 -100
- data/spec/integration/rspec/be_nil_matcher_spec.rb +10 -10
- data/spec/integration/rspec/be_predicate_matcher_spec.rb +103 -103
- data/spec/integration/rspec/be_truthy_matcher_spec.rb +10 -10
- data/spec/integration/rspec/contain_exactly_matcher_spec.rb +113 -107
- data/spec/integration/rspec/eq_matcher_spec.rb +223 -277
- data/spec/integration/rspec/have_attributes_matcher_spec.rb +138 -129
- data/spec/integration/rspec/have_predicate_matcher_spec.rb +65 -65
- data/spec/integration/rspec/include_matcher_spec.rb +73 -73
- data/spec/integration/rspec/match_array_matcher_spec.rb +126 -119
- data/spec/integration/rspec/match_matcher_spec.rb +362 -274
- data/spec/integration/rspec/raise_error_matcher_spec.rb +86 -86
- data/spec/integration/rspec/respond_to_matcher_spec.rb +240 -240
- data/spec/integration/rspec/third_party_matcher_spec.rb +8 -8
- data/spec/integration/rspec/unhandled_errors_spec.rb +5 -5
- data/spec/spec_helper.rb +33 -13
- data/spec/support/command_runner.rb +15 -25
- data/spec/support/helpers.rb +21 -0
- data/spec/support/integration/helpers.rb +8 -2
- data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +4 -4
- data/spec/support/integration/test_programs/base.rb +38 -10
- data/spec/support/integration/test_programs/rspec_active_record.rb +1 -1
- data/spec/support/integration/test_programs/rspec_active_support.rb +17 -0
- data/spec/support/integration/test_programs/rspec_rails.rb +1 -1
- data/spec/support/shared_examples/active_record.rb +109 -108
- data/spec/support/shared_examples/active_support.rb +65 -0
- data/spec/support/shared_examples/elided_diffs.rb +914 -0
- data/spec/support/shared_examples/hash_with_indifferent_access.rb +196 -232
- data/spec/support/unit/helpers.rb +15 -0
- data/spec/support/unit/matchers/match_output.rb +41 -0
- data/spec/unit/active_record/object_inspection_spec.rb +273 -0
- data/spec/unit/equality_matchers/main_spec.rb +445 -465
- data/spec/unit/helpers_spec.rb +61 -0
- data/spec/unit/operation_tree_flatteners/array_spec.rb +604 -0
- data/spec/unit/operation_tree_flatteners/custom_object_spec.rb +667 -0
- data/spec/unit/operation_tree_flatteners/default_object_spec.rb +687 -0
- data/spec/unit/operation_tree_flatteners/hash_spec.rb +632 -0
- data/spec/unit/operation_tree_flatteners/multiline_string_spec.rb +121 -0
- data/spec/unit/rspec/object_inspection_spec.rb +446 -0
- data/spec/unit/super_diff_spec.rb +1958 -0
- data/spec/unit/tiered_lines_elider_spec.rb +6356 -0
- data/spec/unit/tiered_lines_formatter_spec.rb +193 -0
- data/super_diff.gemspec +1 -1
- metadata +95 -50
- data/lib/super_diff/active_record/diff_formatters.rb +0 -10
- data/lib/super_diff/active_record/diff_formatters/active_record_relation.rb +0 -23
- data/lib/super_diff/active_record/object_inspection/inspectors.rb +0 -16
- data/lib/super_diff/active_support/diff_formatters.rb +0 -10
- data/lib/super_diff/active_support/diff_formatters/hash_with_indifferent_access.rb +0 -36
- data/lib/super_diff/active_support/object_inspection/inspectors/hash_with_indifferent_access.rb +0 -28
- data/lib/super_diff/diff_formatters.rb +0 -14
- data/lib/super_diff/diff_formatters/array.rb +0 -21
- data/lib/super_diff/diff_formatters/base.rb +0 -33
- data/lib/super_diff/diff_formatters/custom_object.rb +0 -30
- data/lib/super_diff/diff_formatters/default_object.rb +0 -46
- data/lib/super_diff/diff_formatters/defaults.rb +0 -10
- data/lib/super_diff/diff_formatters/hash.rb +0 -34
- data/lib/super_diff/diff_formatters/main.rb +0 -41
- data/lib/super_diff/object_inspection/inspectors.rb +0 -23
- data/lib/super_diff/object_inspection/inspectors/array.rb +0 -32
- data/lib/super_diff/object_inspection/inspectors/base.rb +0 -36
- data/lib/super_diff/object_inspection/inspectors/custom_object.rb +0 -37
- data/lib/super_diff/object_inspection/inspectors/default_object.rb +0 -61
- data/lib/super_diff/object_inspection/inspectors/hash.rb +0 -32
- data/lib/super_diff/object_inspection/inspectors/primitive.rb +0 -28
- data/lib/super_diff/object_inspection/inspectors/string.rb +0 -23
- data/lib/super_diff/object_inspection/inspectors/time_like.rb +0 -23
- data/lib/super_diff/object_inspection/nodes/break.rb +0 -15
- data/lib/super_diff/object_inspection/nodes/when_multiline.rb +0 -22
- data/lib/super_diff/object_inspection/nodes/when_singleline.rb +0 -24
- data/lib/super_diff/rspec/object_inspection/inspectors.rb +0 -40
- data/lib/super_diff/rspec/object_inspection/inspectors/collection_including.rb +0 -28
- data/lib/super_diff/rspec/object_inspection/inspectors/hash_including.rb +0 -31
- data/lib/super_diff/rspec/object_inspection/inspectors/instance_of.rb +0 -23
- data/lib/super_diff/rspec/object_inspection/inspectors/kind_of.rb +0 -23
- data/lib/super_diff/rspec/object_inspection/inspectors/primitive.rb +0 -13
- data/lib/super_diff/rspec/object_inspection/inspectors/value_within.rb +0 -29
- data/spec/support/object_id.rb +0 -27
- data/spec/support/ruby_versions.rb +0 -11
- data/spec/unit/object_inspection_spec.rb +0 -1168
@@ -0,0 +1,193 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe SuperDiff::TieredLinesFormatter, type: :unit do
|
4
|
+
it "formats the given lines as an array of strings with appropriate colors and indentation" do
|
5
|
+
tiered_lines = [
|
6
|
+
line(
|
7
|
+
type: :noop,
|
8
|
+
indentation_level: 0,
|
9
|
+
value: %([),
|
10
|
+
),
|
11
|
+
line(
|
12
|
+
type: :noop,
|
13
|
+
indentation_level: 1,
|
14
|
+
value: %("foo"),
|
15
|
+
add_comma: true,
|
16
|
+
),
|
17
|
+
line(
|
18
|
+
type: :noop,
|
19
|
+
indentation_level: 1,
|
20
|
+
value: %({),
|
21
|
+
),
|
22
|
+
line(
|
23
|
+
type: :noop,
|
24
|
+
indentation_level: 2,
|
25
|
+
prefix: %(one: ),
|
26
|
+
value: %("fish"),
|
27
|
+
add_comma: true,
|
28
|
+
),
|
29
|
+
line(
|
30
|
+
type: :delete,
|
31
|
+
indentation_level: 2,
|
32
|
+
prefix: %(two: ),
|
33
|
+
value: %("fish"),
|
34
|
+
add_comma: true,
|
35
|
+
),
|
36
|
+
line(
|
37
|
+
type: :insert,
|
38
|
+
indentation_level: 2,
|
39
|
+
prefix: %(two: ),
|
40
|
+
value: %("FISH"),
|
41
|
+
add_comma: true,
|
42
|
+
),
|
43
|
+
line(
|
44
|
+
type: :noop,
|
45
|
+
indentation_level: 2,
|
46
|
+
prefix: %(hard: ),
|
47
|
+
value: %([),
|
48
|
+
),
|
49
|
+
elision(
|
50
|
+
indentation_level: 3,
|
51
|
+
value: %(# ...),
|
52
|
+
children: [
|
53
|
+
line(
|
54
|
+
type: :noop,
|
55
|
+
indentation_level: 3,
|
56
|
+
value: %("a"),
|
57
|
+
),
|
58
|
+
line(
|
59
|
+
type: :noop,
|
60
|
+
indentation_level: 3,
|
61
|
+
value: %("b"),
|
62
|
+
),
|
63
|
+
line(
|
64
|
+
type: :noop,
|
65
|
+
indentation_level: 3,
|
66
|
+
value: %("c"),
|
67
|
+
),
|
68
|
+
],
|
69
|
+
),
|
70
|
+
line(
|
71
|
+
type: :noop,
|
72
|
+
indentation_level: 2,
|
73
|
+
value: %(]),
|
74
|
+
add_comma: true,
|
75
|
+
),
|
76
|
+
line(
|
77
|
+
type: :insert,
|
78
|
+
indentation_level: 2,
|
79
|
+
prefix: %(blue: ),
|
80
|
+
value: %("fish"),
|
81
|
+
add_comma: true,
|
82
|
+
),
|
83
|
+
line(
|
84
|
+
type: :insert,
|
85
|
+
indentation_level: 2,
|
86
|
+
prefix: %(stew: ),
|
87
|
+
value: %("fish"),
|
88
|
+
),
|
89
|
+
line(
|
90
|
+
type: :noop,
|
91
|
+
indentation_level: 1,
|
92
|
+
value: %(}),
|
93
|
+
add_comma: true,
|
94
|
+
),
|
95
|
+
line(
|
96
|
+
type: :noop,
|
97
|
+
indentation_level: 1,
|
98
|
+
value: %(∙∙∙),
|
99
|
+
add_comma: true,
|
100
|
+
),
|
101
|
+
line(
|
102
|
+
type: :delete,
|
103
|
+
indentation_level: 1,
|
104
|
+
value: %("baz"),
|
105
|
+
add_comma: true,
|
106
|
+
),
|
107
|
+
line(
|
108
|
+
type: :insert,
|
109
|
+
indentation_level: 1,
|
110
|
+
value: %(2),
|
111
|
+
add_comma: true,
|
112
|
+
),
|
113
|
+
line(
|
114
|
+
type: :noop,
|
115
|
+
indentation_level: 1,
|
116
|
+
value: %("qux"),
|
117
|
+
add_comma: true,
|
118
|
+
),
|
119
|
+
line(
|
120
|
+
type: :delete,
|
121
|
+
indentation_level: 1,
|
122
|
+
value: %("blargh"),
|
123
|
+
add_comma: true,
|
124
|
+
),
|
125
|
+
line(
|
126
|
+
type: :delete,
|
127
|
+
indentation_level: 1,
|
128
|
+
value: %("zig"),
|
129
|
+
add_comma: true,
|
130
|
+
),
|
131
|
+
line(
|
132
|
+
type: :delete,
|
133
|
+
indentation_level: 1,
|
134
|
+
value: %("zag"),
|
135
|
+
),
|
136
|
+
line(
|
137
|
+
type: :noop,
|
138
|
+
indentation_level: 0,
|
139
|
+
value: %(]),
|
140
|
+
),
|
141
|
+
]
|
142
|
+
|
143
|
+
actual_diff = described_class.call(tiered_lines)
|
144
|
+
|
145
|
+
expected_diff = colored do
|
146
|
+
plain_line %( [)
|
147
|
+
plain_line %( "foo",)
|
148
|
+
plain_line %( {)
|
149
|
+
plain_line %( one: "fish",)
|
150
|
+
expected_line %(- two: "fish",)
|
151
|
+
actual_line %(+ two: "FISH",)
|
152
|
+
plain_line %( hard: [)
|
153
|
+
elision_marker_line %( # ...)
|
154
|
+
plain_line %( ],)
|
155
|
+
actual_line %(+ blue: "fish",)
|
156
|
+
actual_line %(+ stew: "fish")
|
157
|
+
plain_line %( },)
|
158
|
+
plain_line %( ∙∙∙,)
|
159
|
+
expected_line %(- "baz",)
|
160
|
+
actual_line %(+ 2,)
|
161
|
+
plain_line %( "qux",)
|
162
|
+
expected_line %(- "blargh",)
|
163
|
+
expected_line %(- "zig",)
|
164
|
+
expected_line %(- "zag")
|
165
|
+
plain_line %( ])
|
166
|
+
end
|
167
|
+
|
168
|
+
expect(actual_diff).to eq(expected_diff)
|
169
|
+
end
|
170
|
+
|
171
|
+
def line(type:, indentation_level:, value:, prefix: "", add_comma: false)
|
172
|
+
double(
|
173
|
+
:line,
|
174
|
+
type: type,
|
175
|
+
indentation_level: indentation_level,
|
176
|
+
prefix: prefix,
|
177
|
+
value: value,
|
178
|
+
add_comma?: add_comma,
|
179
|
+
)
|
180
|
+
end
|
181
|
+
|
182
|
+
def elision(indentation_level:, value:, children:)
|
183
|
+
double(
|
184
|
+
:elision,
|
185
|
+
type: :elision,
|
186
|
+
indentation_level: indentation_level,
|
187
|
+
prefix: "",
|
188
|
+
value: value,
|
189
|
+
add_comma?: false,
|
190
|
+
children: children,
|
191
|
+
)
|
192
|
+
end
|
193
|
+
end
|
data/super_diff.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
SuperDiff is a gem that hooks into RSpec to intelligently display the
|
13
13
|
differences between two data structures of any type.
|
14
14
|
DESC
|
15
|
-
s.required_ruby_version = "
|
15
|
+
s.required_ruby_version = [">= 2.4", "< 4"]
|
16
16
|
|
17
17
|
s.files = ["README.md", "super_diff.gemspec"] + Dir["lib/**/*"]
|
18
18
|
s.test_files = Dir["spec/**/*"]
|
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
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliot Winkler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: attr_extras
|
@@ -64,30 +64,30 @@ files:
|
|
64
64
|
- README.md
|
65
65
|
- lib/super_diff.rb
|
66
66
|
- lib/super_diff/active_record.rb
|
67
|
-
- lib/super_diff/active_record/diff_formatters.rb
|
68
|
-
- lib/super_diff/active_record/diff_formatters/active_record_relation.rb
|
69
67
|
- lib/super_diff/active_record/differs.rb
|
70
68
|
- lib/super_diff/active_record/differs/active_record_relation.rb
|
71
69
|
- lib/super_diff/active_record/monkey_patches.rb
|
72
70
|
- lib/super_diff/active_record/object_inspection.rb
|
73
|
-
- lib/super_diff/active_record/object_inspection/
|
74
|
-
- lib/super_diff/active_record/object_inspection/
|
75
|
-
- lib/super_diff/active_record/object_inspection/
|
71
|
+
- lib/super_diff/active_record/object_inspection/inspection_tree_builders.rb
|
72
|
+
- lib/super_diff/active_record/object_inspection/inspection_tree_builders/active_record_model.rb
|
73
|
+
- lib/super_diff/active_record/object_inspection/inspection_tree_builders/active_record_relation.rb
|
76
74
|
- lib/super_diff/active_record/operation_tree_builders.rb
|
77
75
|
- lib/super_diff/active_record/operation_tree_builders/active_record_model.rb
|
78
76
|
- lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb
|
77
|
+
- lib/super_diff/active_record/operation_tree_flatteners.rb
|
78
|
+
- lib/super_diff/active_record/operation_tree_flatteners/active_record_relation.rb
|
79
79
|
- lib/super_diff/active_record/operation_trees.rb
|
80
80
|
- lib/super_diff/active_record/operation_trees/active_record_relation.rb
|
81
81
|
- lib/super_diff/active_support.rb
|
82
|
-
- lib/super_diff/active_support/diff_formatters.rb
|
83
|
-
- lib/super_diff/active_support/diff_formatters/hash_with_indifferent_access.rb
|
84
82
|
- lib/super_diff/active_support/differs.rb
|
85
83
|
- lib/super_diff/active_support/differs/hash_with_indifferent_access.rb
|
86
84
|
- lib/super_diff/active_support/object_inspection.rb
|
87
|
-
- lib/super_diff/active_support/object_inspection/
|
88
|
-
- lib/super_diff/active_support/object_inspection/
|
85
|
+
- lib/super_diff/active_support/object_inspection/inspection_tree_builders.rb
|
86
|
+
- lib/super_diff/active_support/object_inspection/inspection_tree_builders/hash_with_indifferent_access.rb
|
89
87
|
- lib/super_diff/active_support/operation_tree_builders.rb
|
90
88
|
- lib/super_diff/active_support/operation_tree_builders/hash_with_indifferent_access.rb
|
89
|
+
- lib/super_diff/active_support/operation_tree_flatteners.rb
|
90
|
+
- lib/super_diff/active_support/operation_tree_flatteners/hash_with_indifferent_access.rb
|
91
91
|
- lib/super_diff/active_support/operation_trees.rb
|
92
92
|
- lib/super_diff/active_support/operation_trees/hash_with_indifferent_access.rb
|
93
93
|
- lib/super_diff/colorized_document_extensions.rb
|
@@ -103,15 +103,7 @@ files:
|
|
103
103
|
- lib/super_diff/csi/reset_sequence.rb
|
104
104
|
- lib/super_diff/csi/twenty_four_bit_color.rb
|
105
105
|
- lib/super_diff/csi/uncolorized_document.rb
|
106
|
-
- lib/super_diff/diff_formatters.rb
|
107
|
-
- lib/super_diff/diff_formatters/array.rb
|
108
|
-
- lib/super_diff/diff_formatters/base.rb
|
109
106
|
- lib/super_diff/diff_formatters/collection.rb
|
110
|
-
- lib/super_diff/diff_formatters/custom_object.rb
|
111
|
-
- lib/super_diff/diff_formatters/default_object.rb
|
112
|
-
- lib/super_diff/diff_formatters/defaults.rb
|
113
|
-
- lib/super_diff/diff_formatters/hash.rb
|
114
|
-
- lib/super_diff/diff_formatters/main.rb
|
115
107
|
- lib/super_diff/diff_formatters/multiline_string.rb
|
116
108
|
- lib/super_diff/differs.rb
|
117
109
|
- lib/super_diff/differs/array.rb
|
@@ -138,31 +130,38 @@ files:
|
|
138
130
|
- lib/super_diff/errors/no_diff_formatter_available_error.rb
|
139
131
|
- lib/super_diff/errors/no_differ_available_error.rb
|
140
132
|
- lib/super_diff/errors/no_operational_sequencer_available_error.rb
|
133
|
+
- lib/super_diff/gem_version.rb
|
141
134
|
- lib/super_diff/helpers.rb
|
142
135
|
- lib/super_diff/implementation_checks.rb
|
136
|
+
- lib/super_diff/line.rb
|
143
137
|
- lib/super_diff/object_inspection.rb
|
144
138
|
- lib/super_diff/object_inspection/inspection_tree.rb
|
145
|
-
- lib/super_diff/object_inspection/
|
146
|
-
- lib/super_diff/object_inspection/
|
147
|
-
- lib/super_diff/object_inspection/
|
148
|
-
- lib/super_diff/object_inspection/
|
149
|
-
- lib/super_diff/object_inspection/
|
150
|
-
- lib/super_diff/object_inspection/
|
151
|
-
- lib/super_diff/object_inspection/
|
152
|
-
- lib/super_diff/object_inspection/
|
153
|
-
- lib/super_diff/object_inspection/
|
154
|
-
- lib/super_diff/object_inspection/
|
155
|
-
- lib/super_diff/object_inspection/inspectors/time_like.rb
|
139
|
+
- lib/super_diff/object_inspection/inspection_tree_builders.rb
|
140
|
+
- lib/super_diff/object_inspection/inspection_tree_builders/array.rb
|
141
|
+
- lib/super_diff/object_inspection/inspection_tree_builders/base.rb
|
142
|
+
- lib/super_diff/object_inspection/inspection_tree_builders/custom_object.rb
|
143
|
+
- lib/super_diff/object_inspection/inspection_tree_builders/default_object.rb
|
144
|
+
- lib/super_diff/object_inspection/inspection_tree_builders/defaults.rb
|
145
|
+
- lib/super_diff/object_inspection/inspection_tree_builders/hash.rb
|
146
|
+
- lib/super_diff/object_inspection/inspection_tree_builders/main.rb
|
147
|
+
- lib/super_diff/object_inspection/inspection_tree_builders/primitive.rb
|
148
|
+
- lib/super_diff/object_inspection/inspection_tree_builders/time_like.rb
|
156
149
|
- lib/super_diff/object_inspection/nodes.rb
|
150
|
+
- lib/super_diff/object_inspection/nodes/as_lines_when_rendering_to_lines.rb
|
151
|
+
- lib/super_diff/object_inspection/nodes/as_prefix_when_rendering_to_lines.rb
|
152
|
+
- lib/super_diff/object_inspection/nodes/as_prelude_when_rendering_to_lines.rb
|
153
|
+
- lib/super_diff/object_inspection/nodes/as_single_line.rb
|
157
154
|
- lib/super_diff/object_inspection/nodes/base.rb
|
158
|
-
- lib/super_diff/object_inspection/nodes/break.rb
|
159
155
|
- lib/super_diff/object_inspection/nodes/inspection.rb
|
160
156
|
- lib/super_diff/object_inspection/nodes/nesting.rb
|
157
|
+
- lib/super_diff/object_inspection/nodes/only_when.rb
|
161
158
|
- lib/super_diff/object_inspection/nodes/text.rb
|
162
159
|
- lib/super_diff/object_inspection/nodes/when_empty.rb
|
163
|
-
- lib/super_diff/object_inspection/nodes/when_multiline.rb
|
164
160
|
- lib/super_diff/object_inspection/nodes/when_non_empty.rb
|
165
|
-
- lib/super_diff/object_inspection/nodes/
|
161
|
+
- lib/super_diff/object_inspection/nodes/when_rendering_to_lines.rb
|
162
|
+
- lib/super_diff/object_inspection/nodes/when_rendering_to_string.rb
|
163
|
+
- lib/super_diff/object_inspection/prefix_for_next_node.rb
|
164
|
+
- lib/super_diff/object_inspection/prelude_for_next_node.rb
|
166
165
|
- lib/super_diff/operation_tree_builders.rb
|
167
166
|
- lib/super_diff/operation_tree_builders/array.rb
|
168
167
|
- lib/super_diff/operation_tree_builders/base.rb
|
@@ -173,6 +172,14 @@ files:
|
|
173
172
|
- lib/super_diff/operation_tree_builders/main.rb
|
174
173
|
- lib/super_diff/operation_tree_builders/multiline_string.rb
|
175
174
|
- lib/super_diff/operation_tree_builders/time_like.rb
|
175
|
+
- lib/super_diff/operation_tree_flatteners.rb
|
176
|
+
- lib/super_diff/operation_tree_flatteners/array.rb
|
177
|
+
- lib/super_diff/operation_tree_flatteners/base.rb
|
178
|
+
- lib/super_diff/operation_tree_flatteners/collection.rb
|
179
|
+
- lib/super_diff/operation_tree_flatteners/custom_object.rb
|
180
|
+
- lib/super_diff/operation_tree_flatteners/default_object.rb
|
181
|
+
- lib/super_diff/operation_tree_flatteners/hash.rb
|
182
|
+
- lib/super_diff/operation_tree_flatteners/multiline_string.rb
|
176
183
|
- lib/super_diff/operation_trees.rb
|
177
184
|
- lib/super_diff/operation_trees/array.rb
|
178
185
|
- lib/super_diff/operation_trees/base.rb
|
@@ -207,23 +214,28 @@ files:
|
|
207
214
|
- lib/super_diff/rspec/matcher_text_template.rb
|
208
215
|
- lib/super_diff/rspec/monkey_patches.rb
|
209
216
|
- lib/super_diff/rspec/object_inspection.rb
|
210
|
-
- lib/super_diff/rspec/object_inspection/
|
211
|
-
- lib/super_diff/rspec/object_inspection/
|
212
|
-
- lib/super_diff/rspec/object_inspection/
|
213
|
-
- lib/super_diff/rspec/object_inspection/
|
214
|
-
- lib/super_diff/rspec/object_inspection/
|
215
|
-
- lib/super_diff/rspec/object_inspection/
|
216
|
-
- lib/super_diff/rspec/object_inspection/
|
217
|
-
- lib/super_diff/rspec/object_inspection/
|
218
|
-
- lib/super_diff/rspec/object_inspection/
|
217
|
+
- lib/super_diff/rspec/object_inspection/inspection_tree_builders.rb
|
218
|
+
- lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_containing_exactly.rb
|
219
|
+
- lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_including.rb
|
220
|
+
- lib/super_diff/rspec/object_inspection/inspection_tree_builders/double.rb
|
221
|
+
- lib/super_diff/rspec/object_inspection/inspection_tree_builders/hash_including.rb
|
222
|
+
- lib/super_diff/rspec/object_inspection/inspection_tree_builders/instance_of.rb
|
223
|
+
- lib/super_diff/rspec/object_inspection/inspection_tree_builders/kind_of.rb
|
224
|
+
- lib/super_diff/rspec/object_inspection/inspection_tree_builders/object_having_attributes.rb
|
225
|
+
- lib/super_diff/rspec/object_inspection/inspection_tree_builders/primitive.rb
|
226
|
+
- lib/super_diff/rspec/object_inspection/inspection_tree_builders/value_within.rb
|
219
227
|
- lib/super_diff/rspec/operation_tree_builders.rb
|
220
228
|
- lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb
|
221
229
|
- lib/super_diff/rspec/operation_tree_builders/collection_including.rb
|
222
230
|
- lib/super_diff/rspec/operation_tree_builders/hash_including.rb
|
223
231
|
- lib/super_diff/rspec/operation_tree_builders/object_having_attributes.rb
|
232
|
+
- lib/super_diff/tiered_lines.rb
|
233
|
+
- lib/super_diff/tiered_lines_elider.rb
|
234
|
+
- lib/super_diff/tiered_lines_formatter.rb
|
224
235
|
- lib/super_diff/version.rb
|
225
236
|
- spec/examples.txt
|
226
237
|
- spec/integration/rails/active_record_spec.rb
|
238
|
+
- spec/integration/rails/active_support_spec.rb
|
227
239
|
- spec/integration/rails/hash_with_indifferent_access_spec.rb
|
228
240
|
- spec/integration/rspec/be_falsey_matcher_spec.rb
|
229
241
|
- spec/integration/rspec/be_matcher_spec.rb
|
@@ -244,12 +256,14 @@ files:
|
|
244
256
|
- spec/spec_helper.rb
|
245
257
|
- spec/support/colorizer.rb
|
246
258
|
- spec/support/command_runner.rb
|
259
|
+
- spec/support/helpers.rb
|
247
260
|
- spec/support/integration/helpers.rb
|
248
261
|
- spec/support/integration/matchers.rb
|
249
262
|
- spec/support/integration/matchers/produce_output_when_run_matcher.rb
|
250
263
|
- spec/support/integration/test_programs/base.rb
|
251
264
|
- spec/support/integration/test_programs/plain.rb
|
252
265
|
- spec/support/integration/test_programs/rspec_active_record.rb
|
266
|
+
- spec/support/integration/test_programs/rspec_active_support.rb
|
253
267
|
- spec/support/integration/test_programs/rspec_rails.rb
|
254
268
|
- spec/support/models/a.rb
|
255
269
|
- spec/support/models/active_record/person.rb
|
@@ -262,12 +276,20 @@ files:
|
|
262
276
|
- spec/support/models/person.rb
|
263
277
|
- spec/support/models/player.rb
|
264
278
|
- spec/support/models/shipping_address.rb
|
265
|
-
- spec/support/object_id.rb
|
266
|
-
- spec/support/ruby_versions.rb
|
267
279
|
- spec/support/shared_examples/active_record.rb
|
280
|
+
- spec/support/shared_examples/active_support.rb
|
281
|
+
- spec/support/shared_examples/elided_diffs.rb
|
268
282
|
- spec/support/shared_examples/hash_with_indifferent_access.rb
|
283
|
+
- spec/support/unit/helpers.rb
|
284
|
+
- spec/support/unit/matchers/match_output.rb
|
285
|
+
- spec/unit/active_record/object_inspection_spec.rb
|
269
286
|
- spec/unit/equality_matchers/main_spec.rb
|
270
|
-
- spec/unit/
|
287
|
+
- spec/unit/helpers_spec.rb
|
288
|
+
- spec/unit/operation_tree_flatteners/array_spec.rb
|
289
|
+
- spec/unit/operation_tree_flatteners/custom_object_spec.rb
|
290
|
+
- spec/unit/operation_tree_flatteners/default_object_spec.rb
|
291
|
+
- spec/unit/operation_tree_flatteners/hash_spec.rb
|
292
|
+
- spec/unit/operation_tree_flatteners/multiline_string_spec.rb
|
271
293
|
- spec/unit/rspec/matchers/be_compared_to_spec.rb
|
272
294
|
- spec/unit/rspec/matchers/be_falsey_spec.rb
|
273
295
|
- spec/unit/rspec/matchers/be_nil_spec.rb
|
@@ -283,6 +305,10 @@ files:
|
|
283
305
|
- spec/unit/rspec/matchers/match_spec.rb
|
284
306
|
- spec/unit/rspec/matchers/raise_error_spec.rb
|
285
307
|
- spec/unit/rspec/matchers/respond_to_spec.rb
|
308
|
+
- spec/unit/rspec/object_inspection_spec.rb
|
309
|
+
- spec/unit/super_diff_spec.rb
|
310
|
+
- spec/unit/tiered_lines_elider_spec.rb
|
311
|
+
- spec/unit/tiered_lines_formatter_spec.rb
|
286
312
|
- super_diff.gemspec
|
287
313
|
homepage: https://github.com/mcmire/super_diff
|
288
314
|
licenses:
|
@@ -294,23 +320,37 @@ require_paths:
|
|
294
320
|
- lib
|
295
321
|
required_ruby_version: !ruby/object:Gem::Requirement
|
296
322
|
requirements:
|
297
|
-
- - "
|
323
|
+
- - ">="
|
298
324
|
- !ruby/object:Gem::Version
|
299
325
|
version: '2.4'
|
326
|
+
- - "<"
|
327
|
+
- !ruby/object:Gem::Version
|
328
|
+
version: '4'
|
300
329
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
301
330
|
requirements:
|
302
331
|
- - ">="
|
303
332
|
- !ruby/object:Gem::Version
|
304
333
|
version: '0'
|
305
334
|
requirements: []
|
306
|
-
|
335
|
+
rubyforge_project:
|
336
|
+
rubygems_version: 2.7.6.3
|
307
337
|
signing_key:
|
308
338
|
specification_version: 4
|
309
339
|
summary: A better way to view differences between complex data structures in RSpec.
|
310
340
|
test_files:
|
311
341
|
- spec/spec_helper.rb
|
342
|
+
- spec/unit/tiered_lines_formatter_spec.rb
|
343
|
+
- spec/unit/operation_tree_flatteners/default_object_spec.rb
|
344
|
+
- spec/unit/operation_tree_flatteners/multiline_string_spec.rb
|
345
|
+
- spec/unit/operation_tree_flatteners/custom_object_spec.rb
|
346
|
+
- spec/unit/operation_tree_flatteners/array_spec.rb
|
347
|
+
- spec/unit/operation_tree_flatteners/hash_spec.rb
|
312
348
|
- spec/unit/equality_matchers/main_spec.rb
|
313
|
-
- spec/unit/object_inspection_spec.rb
|
349
|
+
- spec/unit/active_record/object_inspection_spec.rb
|
350
|
+
- spec/unit/helpers_spec.rb
|
351
|
+
- spec/unit/super_diff_spec.rb
|
352
|
+
- spec/unit/tiered_lines_elider_spec.rb
|
353
|
+
- spec/unit/rspec/object_inspection_spec.rb
|
314
354
|
- spec/unit/rspec/matchers/contain_exactly_spec.rb
|
315
355
|
- spec/unit/rspec/matchers/be_predicate_spec.rb
|
316
356
|
- spec/unit/rspec/matchers/raise_error_spec.rb
|
@@ -343,12 +383,16 @@ test_files:
|
|
343
383
|
- spec/integration/rspec/have_predicate_matcher_spec.rb
|
344
384
|
- spec/integration/rspec/contain_exactly_matcher_spec.rb
|
345
385
|
- spec/integration/rspec/include_matcher_spec.rb
|
386
|
+
- spec/integration/rails/active_support_spec.rb
|
346
387
|
- spec/integration/rails/active_record_spec.rb
|
347
388
|
- spec/integration/rails/hash_with_indifferent_access_spec.rb
|
348
|
-
- spec/support/
|
389
|
+
- spec/support/helpers.rb
|
390
|
+
- spec/support/unit/helpers.rb
|
391
|
+
- spec/support/unit/matchers/match_output.rb
|
349
392
|
- spec/support/integration/test_programs/base.rb
|
350
393
|
- spec/support/integration/test_programs/rspec_rails.rb
|
351
394
|
- spec/support/integration/test_programs/plain.rb
|
395
|
+
- spec/support/integration/test_programs/rspec_active_support.rb
|
352
396
|
- spec/support/integration/test_programs/rspec_active_record.rb
|
353
397
|
- spec/support/integration/helpers.rb
|
354
398
|
- spec/support/integration/matchers.rb
|
@@ -365,7 +409,8 @@ test_files:
|
|
365
409
|
- spec/support/models/order.rb
|
366
410
|
- spec/support/models/person.rb
|
367
411
|
- spec/support/command_runner.rb
|
368
|
-
- spec/support/ruby_versions.rb
|
369
412
|
- spec/support/colorizer.rb
|
370
413
|
- spec/support/shared_examples/hash_with_indifferent_access.rb
|
414
|
+
- spec/support/shared_examples/elided_diffs.rb
|
371
415
|
- spec/support/shared_examples/active_record.rb
|
416
|
+
- spec/support/shared_examples/active_support.rb
|