super_diff 0.4.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +64 -24
- data/lib/super_diff.rb +20 -17
- data/lib/super_diff/active_record.rb +20 -24
- data/lib/super_diff/active_record/diff_formatters/active_record_relation.rb +3 -3
- data/lib/super_diff/active_record/differs/active_record_relation.rb +3 -5
- data/lib/super_diff/active_record/object_inspection/inspectors/active_record_model.rb +32 -22
- data/lib/super_diff/active_record/object_inspection/inspectors/active_record_relation.rb +17 -7
- data/lib/super_diff/active_record/operation_tree_builders.rb +14 -0
- data/lib/super_diff/active_record/{operational_sequencers → operation_tree_builders}/active_record_model.rb +2 -2
- data/lib/super_diff/active_record/{operational_sequencers → operation_tree_builders}/active_record_relation.rb +4 -4
- data/lib/super_diff/active_record/{operation_sequences.rb → operation_trees.rb} +2 -2
- data/lib/super_diff/active_record/{operation_sequences → operation_trees}/active_record_relation.rb +2 -2
- data/lib/super_diff/active_support.rb +16 -19
- data/lib/super_diff/active_support/diff_formatters/hash_with_indifferent_access.rb +3 -3
- data/lib/super_diff/active_support/differs/hash_with_indifferent_access.rb +3 -5
- data/lib/super_diff/active_support/object_inspection/inspectors/hash_with_indifferent_access.rb +17 -7
- data/lib/super_diff/active_support/operation_tree_builders.rb +10 -0
- data/lib/super_diff/active_support/{operational_sequencers → operation_tree_builders}/hash_with_indifferent_access.rb +2 -2
- data/lib/super_diff/active_support/{operation_sequences.rb → operation_trees.rb} +2 -2
- data/lib/super_diff/active_support/{operation_sequences → operation_trees}/hash_with_indifferent_access.rb +2 -2
- data/lib/super_diff/colorized_document_extensions.rb +4 -4
- data/lib/super_diff/configuration.rb +70 -0
- data/lib/super_diff/csi.rb +2 -1
- data/lib/super_diff/diff_formatters.rb +3 -3
- data/lib/super_diff/diff_formatters/array.rb +3 -3
- data/lib/super_diff/diff_formatters/base.rb +3 -2
- data/lib/super_diff/diff_formatters/collection.rb +3 -3
- data/lib/super_diff/diff_formatters/custom_object.rb +3 -3
- data/lib/super_diff/diff_formatters/default_object.rb +6 -8
- data/lib/super_diff/diff_formatters/defaults.rb +10 -0
- data/lib/super_diff/diff_formatters/hash.rb +3 -3
- data/lib/super_diff/diff_formatters/main.rb +41 -0
- data/lib/super_diff/diff_formatters/multiline_string.rb +7 -7
- data/lib/super_diff/differs.rb +4 -11
- data/lib/super_diff/differs/array.rb +2 -11
- data/lib/super_diff/differs/base.rb +20 -3
- data/lib/super_diff/differs/custom_object.rb +2 -11
- data/lib/super_diff/differs/default_object.rb +2 -8
- data/lib/super_diff/differs/defaults.rb +12 -0
- data/lib/super_diff/differs/hash.rb +2 -11
- data/lib/super_diff/differs/main.rb +48 -0
- data/lib/super_diff/differs/multiline_string.rb +2 -14
- data/lib/super_diff/differs/time_like.rb +15 -0
- data/lib/super_diff/equality_matchers.rb +3 -9
- data/lib/super_diff/equality_matchers/array.rb +3 -9
- data/lib/super_diff/equality_matchers/base.rb +1 -1
- data/lib/super_diff/equality_matchers/default.rb +3 -9
- data/lib/super_diff/equality_matchers/defaults.rb +12 -0
- data/lib/super_diff/equality_matchers/hash.rb +3 -9
- data/lib/super_diff/equality_matchers/main.rb +21 -0
- data/lib/super_diff/equality_matchers/multiline_string.rb +3 -9
- data/lib/super_diff/equality_matchers/primitive.rb +2 -2
- data/lib/super_diff/equality_matchers/singleline_string.rb +2 -2
- data/lib/super_diff/errors.rb +16 -0
- data/lib/super_diff/errors/no_diff_formatter_available_error.rb +21 -0
- data/lib/super_diff/errors/no_differ_available_error.rb +24 -0
- data/lib/super_diff/errors/no_operational_sequencer_available_error.rb +22 -0
- data/lib/super_diff/gem_version.rb +45 -0
- data/lib/super_diff/implementation_checks.rb +19 -0
- data/lib/super_diff/object_inspection.rb +1 -10
- data/lib/super_diff/object_inspection/inspection_tree.rb +6 -2
- data/lib/super_diff/object_inspection/inspectors.rb +5 -1
- data/lib/super_diff/object_inspection/inspectors/array.rb +20 -10
- data/lib/super_diff/object_inspection/inspectors/base.rb +36 -0
- data/lib/super_diff/object_inspection/inspectors/custom_object.rb +24 -14
- data/lib/super_diff/object_inspection/inspectors/default_object.rb +44 -30
- data/lib/super_diff/object_inspection/inspectors/defaults.rb +15 -0
- data/lib/super_diff/object_inspection/inspectors/hash.rb +20 -10
- data/lib/super_diff/object_inspection/inspectors/main.rb +35 -0
- data/lib/super_diff/object_inspection/inspectors/primitive.rb +20 -5
- data/lib/super_diff/object_inspection/inspectors/string.rb +15 -5
- data/lib/super_diff/object_inspection/inspectors/time_like.rb +23 -0
- data/lib/super_diff/object_inspection/nodes/inspection.rb +9 -2
- data/lib/super_diff/operation_tree_builders.rb +18 -0
- data/lib/super_diff/{operational_sequencers → operation_tree_builders}/array.rb +38 -59
- data/lib/super_diff/operation_tree_builders/base.rb +98 -0
- data/lib/super_diff/{operational_sequencers → operation_tree_builders}/custom_object.rb +3 -3
- data/lib/super_diff/{operational_sequencers → operation_tree_builders}/default_object.rb +8 -3
- data/lib/super_diff/operation_tree_builders/defaults.rb +5 -0
- data/lib/super_diff/operation_tree_builders/hash.rb +226 -0
- data/lib/super_diff/operation_tree_builders/main.rb +42 -0
- data/lib/super_diff/{operational_sequencers → operation_tree_builders}/multiline_string.rb +3 -3
- data/lib/super_diff/operation_tree_builders/time_like.rb +34 -0
- data/lib/super_diff/operation_trees.rb +13 -0
- data/lib/super_diff/{operation_sequences → operation_trees}/array.rb +5 -1
- data/lib/super_diff/{operation_sequences → operation_trees}/base.rb +9 -1
- data/lib/super_diff/{operation_sequences → operation_trees}/custom_object.rb +5 -1
- data/lib/super_diff/{operation_sequences → operation_trees}/default_object.rb +10 -8
- data/lib/super_diff/operation_trees/defaults.rb +5 -0
- data/lib/super_diff/{operation_sequences → operation_trees}/hash.rb +5 -1
- data/lib/super_diff/operation_trees/main.rb +35 -0
- data/lib/super_diff/operation_trees/multiline_string.rb +18 -0
- data/lib/super_diff/operations/unary_operation.rb +3 -0
- data/lib/super_diff/recursion_guard.rb +2 -0
- data/lib/super_diff/rspec.rb +49 -13
- data/lib/super_diff/rspec/augmented_matcher.rb +1 -1
- data/lib/super_diff/rspec/differ.rb +2 -17
- data/lib/super_diff/rspec/differs/collection_containing_exactly.rb +2 -7
- data/lib/super_diff/rspec/differs/collection_including.rb +2 -7
- data/lib/super_diff/rspec/differs/hash_including.rb +2 -7
- data/lib/super_diff/rspec/differs/object_having_attributes.rb +2 -7
- 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/match.rb +1 -1
- data/lib/super_diff/rspec/matcher_text_builders/raise_error.rb +1 -1
- data/lib/super_diff/rspec/matcher_text_builders/respond_to.rb +6 -6
- data/lib/super_diff/rspec/matcher_text_template.rb +1 -1
- data/lib/super_diff/rspec/monkey_patches.rb +23 -14
- data/lib/super_diff/rspec/object_inspection.rb +0 -1
- data/lib/super_diff/rspec/object_inspection/inspectors.rb +16 -0
- data/lib/super_diff/rspec/object_inspection/inspectors/collection_containing_exactly.rb +17 -8
- data/lib/super_diff/rspec/object_inspection/inspectors/collection_including.rb +15 -9
- data/lib/super_diff/rspec/object_inspection/inspectors/hash_including.rb +20 -10
- data/lib/super_diff/rspec/object_inspection/inspectors/instance_of.rb +23 -0
- data/lib/super_diff/rspec/object_inspection/inspectors/kind_of.rb +23 -0
- data/lib/super_diff/rspec/object_inspection/inspectors/object_having_attributes.rb +20 -11
- data/lib/super_diff/rspec/object_inspection/inspectors/primitive.rb +13 -0
- data/lib/super_diff/rspec/object_inspection/inspectors/value_within.rb +29 -0
- data/lib/super_diff/rspec/operation_tree_builders.rb +22 -0
- data/lib/super_diff/rspec/{operational_sequencers → operation_tree_builders}/collection_containing_exactly.rb +17 -6
- data/lib/super_diff/rspec/{operational_sequencers → operation_tree_builders}/collection_including.rb +2 -2
- data/lib/super_diff/rspec/{operational_sequencers → operation_tree_builders}/hash_including.rb +3 -11
- data/lib/super_diff/rspec/{operational_sequencers → operation_tree_builders}/object_having_attributes.rb +4 -8
- data/lib/super_diff/version.rb +1 -1
- data/spec/examples.txt +393 -393
- 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 +107 -107
- data/spec/integration/rspec/eq_matcher_spec.rb +230 -230
- data/spec/integration/rspec/have_attributes_matcher_spec.rb +360 -233
- 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 +149 -107
- data/spec/integration/rspec/match_matcher_spec.rb +274 -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 +69 -13
- data/spec/spec_helper.rb +22 -13
- data/spec/support/command_runner.rb +3 -0
- data/spec/support/integration/helpers.rb +15 -95
- data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +15 -30
- data/spec/support/integration/test_programs/base.rb +122 -0
- data/spec/support/integration/test_programs/plain.rb +13 -0
- data/spec/support/integration/test_programs/rspec_active_record.rb +17 -0
- data/spec/support/integration/test_programs/rspec_active_support.rb +17 -0
- data/spec/support/integration/test_programs/rspec_rails.rb +17 -0
- data/spec/support/models/active_record/person.rb +4 -11
- data/spec/support/models/active_record/shipping_address.rb +10 -14
- data/spec/support/object_id.rb +6 -5
- data/spec/support/shared_examples/active_record.rb +108 -108
- data/spec/support/shared_examples/hash_with_indifferent_access.rb +196 -232
- data/spec/tmp/integration_spec.rb +15 -0
- data/spec/unit/{equality_matcher_spec.rb → equality_matchers/main_spec.rb} +518 -362
- data/spec/unit/object_inspection_spec.rb +77 -1
- data/super_diff.gemspec +3 -2
- metadata +83 -54
- data/lib/super_diff/active_record/object_inspection/map_extension.rb +0 -18
- data/lib/super_diff/active_record/operational_sequencers.rb +0 -14
- data/lib/super_diff/active_support/object_inspection/map_extension.rb +0 -15
- data/lib/super_diff/active_support/operational_sequencers.rb +0 -10
- data/lib/super_diff/diff_formatter.rb +0 -32
- data/lib/super_diff/differ.rb +0 -51
- data/lib/super_diff/differs/time.rb +0 -24
- data/lib/super_diff/equality_matcher.rb +0 -32
- data/lib/super_diff/no_differ_available_error.rb +0 -22
- data/lib/super_diff/no_operational_sequencer_available_error.rb +0 -20
- data/lib/super_diff/object_inspection/inspector.rb +0 -27
- data/lib/super_diff/object_inspection/inspectors/time.rb +0 -13
- data/lib/super_diff/object_inspection/map.rb +0 -30
- data/lib/super_diff/operation_sequences.rb +0 -9
- data/lib/super_diff/operational_sequencer.rb +0 -48
- data/lib/super_diff/operational_sequencers.rb +0 -17
- data/lib/super_diff/operational_sequencers/base.rb +0 -89
- data/lib/super_diff/operational_sequencers/hash.rb +0 -85
- data/lib/super_diff/operational_sequencers/time_like.rb +0 -30
- data/lib/super_diff/rspec/configuration.rb +0 -31
- data/lib/super_diff/rspec/object_inspection/map_extension.rb +0 -23
- data/lib/super_diff/rspec/operational_sequencers.rb +0 -22
@@ -0,0 +1,15 @@
|
|
1
|
+
require "/Users/elliot/code/github/mine/super_diff/spec/config/zeus_plan.rb"
|
2
|
+
|
3
|
+
zeus_plan = CustomZeusPlan.new
|
4
|
+
zeus_plan.boot
|
5
|
+
|
6
|
+
zeus_plan.run_plain_test
|
7
|
+
|
8
|
+
RSpec.describe "test" do
|
9
|
+
it "passes" do
|
10
|
+
expected = "This is a line\nAnd that's a line\nAnd there's a line too\n"
|
11
|
+
actual = "This is a line\nSomething completely different\nAnd there's a line too\n"
|
12
|
+
expect(actual).to eq(expected)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
RSpec.describe SuperDiff::
|
3
|
+
RSpec.describe SuperDiff::EqualityMatchers::Main do
|
4
4
|
describe "#call" do
|
5
5
|
context "given the same integers" do
|
6
6
|
it "returns an empty string" do
|
@@ -27,8 +27,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
27
27
|
|
28
28
|
#{
|
29
29
|
colored do
|
30
|
-
|
31
|
-
|
30
|
+
expected_line %(Expected: 42)
|
31
|
+
actual_line %( Actual: 1)
|
32
32
|
end
|
33
33
|
}
|
34
34
|
STR
|
@@ -54,8 +54,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
54
54
|
|
55
55
|
#{
|
56
56
|
colored do
|
57
|
-
|
58
|
-
|
57
|
+
expected_line %(Expected: :foo)
|
58
|
+
actual_line %( Actual: :bar)
|
59
59
|
end
|
60
60
|
}
|
61
61
|
STR
|
@@ -84,8 +84,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
84
84
|
|
85
85
|
#{
|
86
86
|
colored do
|
87
|
-
|
88
|
-
|
87
|
+
expected_line %(Expected: "Marty")
|
88
|
+
actual_line %( Actual: "Jennifer")
|
89
89
|
end
|
90
90
|
}
|
91
91
|
STR
|
@@ -106,8 +106,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
106
106
|
|
107
107
|
#{
|
108
108
|
colored do
|
109
|
-
|
110
|
-
|
109
|
+
expected_line %(Expected: "Marty")
|
110
|
+
actual_line %( Actual: "Marty McFly")
|
111
111
|
end
|
112
112
|
}
|
113
113
|
STR
|
@@ -128,8 +128,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
128
128
|
|
129
129
|
#{
|
130
130
|
colored do
|
131
|
-
|
132
|
-
|
131
|
+
expected_line %(Expected: "Something entirely different")
|
132
|
+
actual_line %( Actual: "This is a line\\nAnd that's another line\\n")
|
133
133
|
end
|
134
134
|
}
|
135
135
|
STR
|
@@ -150,8 +150,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
150
150
|
|
151
151
|
#{
|
152
152
|
colored do
|
153
|
-
|
154
|
-
|
153
|
+
expected_line %(Expected: "This is a line\\nAnd that's another line\\n")
|
154
|
+
actual_line %( Actual: "Something entirely different")
|
155
155
|
end
|
156
156
|
}
|
157
157
|
STR
|
@@ -172,8 +172,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
172
172
|
|
173
173
|
#{
|
174
174
|
colored do
|
175
|
-
|
176
|
-
|
175
|
+
expected_line %(Expected: "This is a line\\nAnd that's a line\\nAnd there's a line too")
|
176
|
+
actual_line %( Actual: "This is a line\\nSomething completely different\\nAnd there's a line too")
|
177
177
|
end
|
178
178
|
}
|
179
179
|
|
@@ -181,10 +181,10 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
181
181
|
|
182
182
|
#{
|
183
183
|
colored do
|
184
|
-
plain_line
|
185
|
-
|
186
|
-
|
187
|
-
plain_line
|
184
|
+
plain_line %( This is a line\\n)
|
185
|
+
expected_line %(- And that's a line\\n)
|
186
|
+
actual_line %(+ Something completely different\\n)
|
187
|
+
plain_line %( And there's a line too)
|
188
188
|
end
|
189
189
|
}
|
190
190
|
STR
|
@@ -205,8 +205,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
205
205
|
|
206
206
|
#{
|
207
207
|
colored do
|
208
|
-
|
209
|
-
|
208
|
+
expected_line %(Expected: "This is a line\\nAnd that's a line\\n")
|
209
|
+
actual_line %( Actual: "Something completely different\\nAnd something else too\\n")
|
210
210
|
end
|
211
211
|
}
|
212
212
|
|
@@ -214,10 +214,10 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
214
214
|
|
215
215
|
#{
|
216
216
|
colored do
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
217
|
+
expected_line %(- This is a line\\n)
|
218
|
+
expected_line %(- And that's a line\\n)
|
219
|
+
actual_line %(+ Something completely different\\n)
|
220
|
+
actual_line %(+ And something else too\\n)
|
221
221
|
end
|
222
222
|
}
|
223
223
|
STR
|
@@ -264,12 +264,12 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
264
264
|
|
265
265
|
#{
|
266
266
|
colored do
|
267
|
-
|
267
|
+
expected_line do
|
268
268
|
text "Expected: "
|
269
269
|
text %("\\e[34mThis is a line\\e[0m\\n\\e[38;5;176mAnd that's a line\\e[0m\\n\\e[38;2;47;59;164mAnd there's a line too\\e[0m\\n")
|
270
270
|
end
|
271
271
|
|
272
|
-
|
272
|
+
actual_line do
|
273
273
|
text " Actual: "
|
274
274
|
text %("\\e[34mThis is a line\\e[0m\\n\\e[38;5;176mSomething completely different\\e[0m\\n\\e[38;2;47;59;164mAnd there's a line too\\e[0m\\n")
|
275
275
|
end
|
@@ -280,10 +280,10 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
280
280
|
|
281
281
|
#{
|
282
282
|
colored do
|
283
|
-
plain_line
|
284
|
-
|
285
|
-
|
286
|
-
plain_line
|
283
|
+
plain_line %( \\e[34mThis is a line\\e[0m\\n)
|
284
|
+
expected_line %(- \\e[38;5;176mAnd that's a line\\e[0m\\n)
|
285
|
+
actual_line %(+ \\e[38;5;176mSomething completely different\\e[0m\\n)
|
286
|
+
plain_line %( \\e[38;2;47;59;164mAnd there's a line too\\e[0m\\n)
|
287
287
|
end
|
288
288
|
}
|
289
289
|
STR
|
@@ -315,8 +315,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
315
315
|
|
316
316
|
#{
|
317
317
|
colored do
|
318
|
-
|
319
|
-
|
318
|
+
expected_line %(Expected: [1, 2, 3, 4])
|
319
|
+
actual_line %( Actual: [1, 2, 99, 4])
|
320
320
|
end
|
321
321
|
}
|
322
322
|
|
@@ -324,13 +324,13 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
324
324
|
|
325
325
|
#{
|
326
326
|
colored do
|
327
|
-
plain_line
|
328
|
-
plain_line
|
329
|
-
plain_line
|
330
|
-
|
331
|
-
|
332
|
-
plain_line
|
333
|
-
plain_line
|
327
|
+
plain_line %( [)
|
328
|
+
plain_line %( 1,)
|
329
|
+
plain_line %( 2,)
|
330
|
+
expected_line %(- 3,)
|
331
|
+
actual_line %(+ 99,)
|
332
|
+
plain_line %( 4)
|
333
|
+
plain_line %( ])
|
334
334
|
end
|
335
335
|
}
|
336
336
|
STR
|
@@ -351,8 +351,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
351
351
|
|
352
352
|
#{
|
353
353
|
colored do
|
354
|
-
|
355
|
-
|
354
|
+
expected_line %(Expected: [:one, :fish, :two, :fish])
|
355
|
+
actual_line %( Actual: [:one, :FISH, :two, :fish])
|
356
356
|
end
|
357
357
|
}
|
358
358
|
|
@@ -360,13 +360,13 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
360
360
|
|
361
361
|
#{
|
362
362
|
colored do
|
363
|
-
plain_line
|
364
|
-
plain_line
|
365
|
-
|
366
|
-
|
367
|
-
plain_line
|
368
|
-
plain_line
|
369
|
-
plain_line
|
363
|
+
plain_line %( [)
|
364
|
+
plain_line %( :one,)
|
365
|
+
expected_line %(- :fish,)
|
366
|
+
actual_line %(+ :FISH,)
|
367
|
+
plain_line %( :two,)
|
368
|
+
plain_line %( :fish)
|
369
|
+
plain_line %( ])
|
370
370
|
end
|
371
371
|
}
|
372
372
|
STR
|
@@ -387,8 +387,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
387
387
|
|
388
388
|
#{
|
389
389
|
colored do
|
390
|
-
|
391
|
-
|
390
|
+
expected_line %(Expected: ["sausage", "egg", "cheese"])
|
391
|
+
actual_line %( Actual: ["bacon", "egg", "cheese"])
|
392
392
|
end
|
393
393
|
}
|
394
394
|
|
@@ -396,12 +396,12 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
396
396
|
|
397
397
|
#{
|
398
398
|
colored do
|
399
|
-
plain_line
|
400
|
-
|
401
|
-
|
402
|
-
plain_line
|
403
|
-
plain_line
|
404
|
-
plain_line
|
399
|
+
plain_line %( [)
|
400
|
+
expected_line %(- "sausage",)
|
401
|
+
actual_line %(+ "bacon",)
|
402
|
+
plain_line %( "egg",)
|
403
|
+
plain_line %( "cheese")
|
404
|
+
plain_line %( ])
|
405
405
|
end
|
406
406
|
}
|
407
407
|
STR
|
@@ -428,8 +428,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
428
428
|
|
429
429
|
#{
|
430
430
|
colored do
|
431
|
-
|
432
|
-
|
431
|
+
expected_line %(Expected: [#<SuperDiff::Test::Person name: "Marty", age: 18>, #<SuperDiff::Test::Person name: "Jennifer", age: 17>])
|
432
|
+
actual_line %( Actual: [#<SuperDiff::Test::Person name: "Marty", age: 18>, #<SuperDiff::Test::Person name: "Doc", age: 50>])
|
433
433
|
end
|
434
434
|
}
|
435
435
|
|
@@ -437,18 +437,18 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
437
437
|
|
438
438
|
#{
|
439
439
|
colored do
|
440
|
-
plain_line
|
441
|
-
plain_line
|
442
|
-
plain_line
|
443
|
-
plain_line
|
444
|
-
plain_line
|
445
|
-
plain_line
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
plain_line
|
451
|
-
plain_line
|
440
|
+
plain_line %( [)
|
441
|
+
plain_line %( #<SuperDiff::Test::Person {)
|
442
|
+
plain_line %( name: "Marty",)
|
443
|
+
plain_line %( age: 18)
|
444
|
+
plain_line %( }>,)
|
445
|
+
plain_line %( #<SuperDiff::Test::Person {)
|
446
|
+
expected_line %(- name: "Jennifer",)
|
447
|
+
actual_line %(+ name: "Doc",)
|
448
|
+
expected_line %(- age: 17)
|
449
|
+
actual_line %(+ age: 50)
|
450
|
+
plain_line %( }>)
|
451
|
+
plain_line %( ])
|
452
452
|
end
|
453
453
|
}
|
454
454
|
STR
|
@@ -469,8 +469,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
469
469
|
|
470
470
|
#{
|
471
471
|
colored do
|
472
|
-
|
473
|
-
|
472
|
+
expected_line %(Expected: ["bread"])
|
473
|
+
actual_line %( Actual: ["bread", "eggs", "milk"])
|
474
474
|
end
|
475
475
|
}
|
476
476
|
|
@@ -478,11 +478,11 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
478
478
|
|
479
479
|
#{
|
480
480
|
colored do
|
481
|
-
plain_line
|
482
|
-
plain_line
|
483
|
-
|
484
|
-
|
485
|
-
plain_line
|
481
|
+
plain_line %( [)
|
482
|
+
plain_line %( "bread",)
|
483
|
+
actual_line %(+ "eggs",)
|
484
|
+
actual_line %(+ "milk")
|
485
|
+
plain_line %( ])
|
486
486
|
end
|
487
487
|
}
|
488
488
|
STR
|
@@ -503,8 +503,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
503
503
|
|
504
504
|
#{
|
505
505
|
colored do
|
506
|
-
|
507
|
-
|
506
|
+
expected_line %(Expected: ["bread", "eggs", "milk"])
|
507
|
+
actual_line %( Actual: ["bread"])
|
508
508
|
end
|
509
509
|
}
|
510
510
|
|
@@ -512,11 +512,11 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
512
512
|
|
513
513
|
#{
|
514
514
|
colored do
|
515
|
-
plain_line
|
516
|
-
plain_line
|
517
|
-
|
518
|
-
|
519
|
-
plain_line
|
515
|
+
plain_line %( [)
|
516
|
+
plain_line %( "bread")
|
517
|
+
expected_line %(- "eggs",)
|
518
|
+
expected_line %(- "milk")
|
519
|
+
plain_line %( ])
|
520
520
|
end
|
521
521
|
}
|
522
522
|
STR
|
@@ -537,8 +537,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
537
537
|
|
538
538
|
#{
|
539
539
|
colored do
|
540
|
-
|
541
|
-
|
540
|
+
expected_line %(Expected: ["milk"])
|
541
|
+
actual_line %( Actual: ["bread", "eggs", "milk"])
|
542
542
|
end
|
543
543
|
}
|
544
544
|
|
@@ -546,11 +546,11 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
546
546
|
|
547
547
|
#{
|
548
548
|
colored do
|
549
|
-
plain_line
|
550
|
-
|
551
|
-
|
552
|
-
plain_line
|
553
|
-
plain_line
|
549
|
+
plain_line %( [)
|
550
|
+
actual_line %(+ "bread",)
|
551
|
+
actual_line %(+ "eggs",)
|
552
|
+
plain_line %( "milk")
|
553
|
+
plain_line %( ])
|
554
554
|
end
|
555
555
|
}
|
556
556
|
STR
|
@@ -571,8 +571,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
571
571
|
|
572
572
|
#{
|
573
573
|
colored do
|
574
|
-
|
575
|
-
|
574
|
+
expected_line %(Expected: ["bread", "eggs", "milk"])
|
575
|
+
actual_line %( Actual: ["milk"])
|
576
576
|
end
|
577
577
|
}
|
578
578
|
|
@@ -580,11 +580,11 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
580
580
|
|
581
581
|
#{
|
582
582
|
colored do
|
583
|
-
plain_line
|
584
|
-
|
585
|
-
|
586
|
-
plain_line
|
587
|
-
plain_line
|
583
|
+
plain_line %( [)
|
584
|
+
expected_line %(- "bread",)
|
585
|
+
expected_line %(- "eggs",)
|
586
|
+
plain_line %( "milk")
|
587
|
+
plain_line %( ])
|
588
588
|
end
|
589
589
|
}
|
590
590
|
STR
|
@@ -605,8 +605,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
605
605
|
|
606
606
|
#{
|
607
607
|
colored do
|
608
|
-
|
609
|
-
|
608
|
+
expected_line %(Expected: [1, 2, [:a, :b, :c], 4])
|
609
|
+
actual_line %( Actual: [1, 2, [:a, :x, :c], 4])
|
610
610
|
end
|
611
611
|
}
|
612
612
|
|
@@ -614,17 +614,17 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
614
614
|
|
615
615
|
#{
|
616
616
|
colored do
|
617
|
-
plain_line
|
618
|
-
plain_line
|
619
|
-
plain_line
|
620
|
-
plain_line
|
621
|
-
plain_line
|
622
|
-
|
623
|
-
|
624
|
-
plain_line
|
625
|
-
plain_line
|
626
|
-
plain_line
|
627
|
-
plain_line
|
617
|
+
plain_line %( [)
|
618
|
+
plain_line %( 1,)
|
619
|
+
plain_line %( 2,)
|
620
|
+
plain_line %( [)
|
621
|
+
plain_line %( :a,)
|
622
|
+
expected_line %(- :b,)
|
623
|
+
actual_line %(+ :x,)
|
624
|
+
plain_line %( :c)
|
625
|
+
plain_line %( ],)
|
626
|
+
plain_line %( 4)
|
627
|
+
plain_line %( ])
|
628
628
|
end
|
629
629
|
}
|
630
630
|
STR
|
@@ -645,8 +645,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
645
645
|
|
646
646
|
#{
|
647
647
|
colored do
|
648
|
-
|
649
|
-
|
648
|
+
expected_line %(Expected: [1, 2, { foo: "bar", baz: "qux" }, 4])
|
649
|
+
actual_line %( Actual: [1, 2, { foo: "bar", baz: "qox" }, 4])
|
650
650
|
end
|
651
651
|
}
|
652
652
|
|
@@ -654,16 +654,16 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
654
654
|
|
655
655
|
#{
|
656
656
|
colored do
|
657
|
-
plain_line
|
658
|
-
plain_line
|
659
|
-
plain_line
|
660
|
-
plain_line
|
661
|
-
plain_line
|
662
|
-
|
663
|
-
|
664
|
-
plain_line
|
665
|
-
plain_line
|
666
|
-
plain_line
|
657
|
+
plain_line %( [)
|
658
|
+
plain_line %( 1,)
|
659
|
+
plain_line %( 2,)
|
660
|
+
plain_line %( {)
|
661
|
+
plain_line %( foo: "bar",)
|
662
|
+
expected_line %(- baz: "qux")
|
663
|
+
actual_line %(+ baz: "qox")
|
664
|
+
plain_line %( },)
|
665
|
+
plain_line %( 4)
|
666
|
+
plain_line %( ])
|
667
667
|
end
|
668
668
|
}
|
669
669
|
STR
|
@@ -689,8 +689,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
689
689
|
|
690
690
|
#{
|
691
691
|
colored do
|
692
|
-
|
693
|
-
|
692
|
+
expected_line %(Expected: [1, 2, #<SuperDiff::Test::Person name: "Marty", age: 18>, 4])
|
693
|
+
actual_line %( Actual: [1, 2, #<SuperDiff::Test::Person name: "Doc", age: 50>, 4])
|
694
694
|
end
|
695
695
|
}
|
696
696
|
|
@@ -698,17 +698,17 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
698
698
|
|
699
699
|
#{
|
700
700
|
colored do
|
701
|
-
plain_line
|
702
|
-
plain_line
|
703
|
-
plain_line
|
704
|
-
plain_line
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
plain_line
|
710
|
-
plain_line
|
711
|
-
plain_line
|
701
|
+
plain_line %( [)
|
702
|
+
plain_line %( 1,)
|
703
|
+
plain_line %( 2,)
|
704
|
+
plain_line %( #<SuperDiff::Test::Person {)
|
705
|
+
expected_line %(- name: "Marty",)
|
706
|
+
actual_line %(+ name: "Doc",)
|
707
|
+
expected_line %(- age: 18)
|
708
|
+
actual_line %(+ age: 50)
|
709
|
+
plain_line %( }>,)
|
710
|
+
plain_line %( 4)
|
711
|
+
plain_line %( ])
|
712
712
|
end
|
713
713
|
}
|
714
714
|
STR
|
@@ -749,8 +749,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
749
749
|
|
750
750
|
#{
|
751
751
|
colored do
|
752
|
-
|
753
|
-
|
752
|
+
expected_line %(Expected: [[:h1, [:span, [:text, "Hello world"]], { class: "header", data: { "sticky" => true } }]])
|
753
|
+
actual_line %( Actual: [[:h2, [:span, [:text, "Goodbye world"]], { id: "hero", class: "header", data: { "sticky" => false, :role => "deprecated" } }], :br])
|
754
754
|
end
|
755
755
|
}
|
756
756
|
|
@@ -758,30 +758,30 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
758
758
|
|
759
759
|
#{
|
760
760
|
colored do
|
761
|
-
plain_line
|
762
|
-
plain_line
|
763
|
-
|
764
|
-
|
765
|
-
plain_line
|
766
|
-
plain_line
|
767
|
-
plain_line
|
768
|
-
plain_line
|
769
|
-
|
770
|
-
|
771
|
-
plain_line
|
772
|
-
plain_line
|
773
|
-
plain_line
|
774
|
-
|
775
|
-
plain_line
|
776
|
-
plain_line
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
plain_line
|
781
|
-
plain_line
|
782
|
-
plain_line
|
783
|
-
|
784
|
-
plain_line
|
761
|
+
plain_line %( [)
|
762
|
+
plain_line %( [)
|
763
|
+
expected_line %(- :h1,)
|
764
|
+
actual_line %(+ :h2,)
|
765
|
+
plain_line %( [)
|
766
|
+
plain_line %( :span,)
|
767
|
+
plain_line %( [)
|
768
|
+
plain_line %( :text,)
|
769
|
+
expected_line %(- "Hello world")
|
770
|
+
actual_line %(+ "Goodbye world")
|
771
|
+
plain_line %( ])
|
772
|
+
plain_line %( ],)
|
773
|
+
plain_line %( {)
|
774
|
+
actual_line %(+ id: "hero",)
|
775
|
+
plain_line %( class: "header",)
|
776
|
+
plain_line %( data: {)
|
777
|
+
expected_line %(- "sticky" => true)
|
778
|
+
actual_line %(+ "sticky" => false,)
|
779
|
+
actual_line %(+ role: "deprecated")
|
780
|
+
plain_line %( })
|
781
|
+
plain_line %( })
|
782
|
+
plain_line %( ],)
|
783
|
+
actual_line %(+ :br)
|
784
|
+
plain_line %( ])
|
785
785
|
end
|
786
786
|
}
|
787
787
|
STR
|
@@ -813,8 +813,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
813
813
|
|
814
814
|
#{
|
815
815
|
colored do
|
816
|
-
|
817
|
-
|
816
|
+
expected_line %(Expected: { tall: 12, grande: 19, venti: 20 })
|
817
|
+
actual_line %( Actual: { tall: 12, grande: 16, venti: 20 })
|
818
818
|
end
|
819
819
|
}
|
820
820
|
|
@@ -822,12 +822,12 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
822
822
|
|
823
823
|
#{
|
824
824
|
colored do
|
825
|
-
plain_line
|
826
|
-
plain_line
|
827
|
-
|
828
|
-
|
829
|
-
plain_line
|
830
|
-
plain_line
|
825
|
+
plain_line %( {)
|
826
|
+
plain_line %( tall: 12,)
|
827
|
+
expected_line %(- grande: 19,)
|
828
|
+
actual_line %(+ grande: 16,)
|
829
|
+
plain_line %( venti: 20)
|
830
|
+
plain_line %( })
|
831
831
|
end
|
832
832
|
}
|
833
833
|
STR
|
@@ -848,8 +848,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
848
848
|
|
849
849
|
#{
|
850
850
|
colored do
|
851
|
-
|
852
|
-
|
851
|
+
expected_line %(Expected: { "tall" => 12, "grande" => 19, "venti" => 20 })
|
852
|
+
actual_line %( Actual: { "tall" => 12, "grande" => 16, "venti" => 20 })
|
853
853
|
end
|
854
854
|
}
|
855
855
|
|
@@ -857,12 +857,12 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
857
857
|
|
858
858
|
#{
|
859
859
|
colored do
|
860
|
-
plain_line
|
861
|
-
plain_line
|
862
|
-
|
863
|
-
|
864
|
-
plain_line
|
865
|
-
plain_line
|
860
|
+
plain_line %( {)
|
861
|
+
plain_line %( "tall" => 12,)
|
862
|
+
expected_line %(- "grande" => 19,)
|
863
|
+
actual_line %(+ "grande" => 16,)
|
864
|
+
plain_line %( "venti" => 20)
|
865
|
+
plain_line %( })
|
866
866
|
end
|
867
867
|
}
|
868
868
|
STR
|
@@ -883,8 +883,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
883
883
|
|
884
884
|
#{
|
885
885
|
colored do
|
886
|
-
|
887
|
-
|
886
|
+
expected_line %(Expected: { tall: :small, grande: :grand, venti: :large })
|
887
|
+
actual_line %( Actual: { tall: :small, grande: :medium, venti: :large })
|
888
888
|
end
|
889
889
|
}
|
890
890
|
|
@@ -892,12 +892,12 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
892
892
|
|
893
893
|
#{
|
894
894
|
colored do
|
895
|
-
plain_line
|
896
|
-
plain_line
|
897
|
-
|
898
|
-
|
899
|
-
plain_line
|
900
|
-
plain_line
|
895
|
+
plain_line %( {)
|
896
|
+
plain_line %( tall: :small,)
|
897
|
+
expected_line %(- grande: :grand,)
|
898
|
+
actual_line %(+ grande: :medium,)
|
899
|
+
plain_line %( venti: :large)
|
900
|
+
plain_line %( })
|
901
901
|
end
|
902
902
|
}
|
903
903
|
STR
|
@@ -918,8 +918,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
918
918
|
|
919
919
|
#{
|
920
920
|
colored do
|
921
|
-
|
922
|
-
|
921
|
+
expected_line %(Expected: { tall: "small", grande: "grand", venti: "large" })
|
922
|
+
actual_line %( Actual: { tall: "small", grande: "medium", venti: "large" })
|
923
923
|
end
|
924
924
|
}
|
925
925
|
|
@@ -927,12 +927,12 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
927
927
|
|
928
928
|
#{
|
929
929
|
colored do
|
930
|
-
plain_line
|
931
|
-
plain_line
|
932
|
-
|
933
|
-
|
934
|
-
plain_line
|
935
|
-
plain_line
|
930
|
+
plain_line %( {)
|
931
|
+
plain_line %( tall: "small",)
|
932
|
+
expected_line %(- grande: "grand",)
|
933
|
+
actual_line %(+ grande: "medium",)
|
934
|
+
plain_line %( venti: "large")
|
935
|
+
plain_line %( })
|
936
936
|
end
|
937
937
|
}
|
938
938
|
STR
|
@@ -959,8 +959,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
959
959
|
|
960
960
|
#{
|
961
961
|
colored do
|
962
|
-
|
963
|
-
|
962
|
+
expected_line %(Expected: { steve: #<SuperDiff::Test::Person name: "Jobs", age: 30>, susan: #<SuperDiff::Test::Person name: "Kare", age: 27> })
|
963
|
+
actual_line %( Actual: { steve: #<SuperDiff::Test::Person name: "Wozniak", age: 33>, susan: #<SuperDiff::Test::Person name: "Kare", age: 27> })
|
964
964
|
end
|
965
965
|
}
|
966
966
|
|
@@ -968,18 +968,18 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
968
968
|
|
969
969
|
#{
|
970
970
|
colored do
|
971
|
-
plain_line
|
972
|
-
plain_line
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
plain_line
|
978
|
-
plain_line
|
979
|
-
plain_line
|
980
|
-
plain_line
|
981
|
-
plain_line
|
982
|
-
plain_line
|
971
|
+
plain_line %( {)
|
972
|
+
plain_line %( steve: #<SuperDiff::Test::Person {)
|
973
|
+
expected_line %(- name: "Jobs",)
|
974
|
+
actual_line %(+ name: "Wozniak",)
|
975
|
+
expected_line %(- age: 30)
|
976
|
+
actual_line %(+ age: 33)
|
977
|
+
plain_line %( }>,)
|
978
|
+
plain_line %( susan: #<SuperDiff::Test::Person {)
|
979
|
+
plain_line %( name: "Kare",)
|
980
|
+
plain_line %( age: 27)
|
981
|
+
plain_line %( }>)
|
982
|
+
plain_line %( })
|
983
983
|
end
|
984
984
|
}
|
985
985
|
STR
|
@@ -1000,8 +1000,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1000
1000
|
|
1001
1001
|
#{
|
1002
1002
|
colored do
|
1003
|
-
|
1004
|
-
|
1003
|
+
expected_line %(Expected: { latte: 4.5 })
|
1004
|
+
actual_line %( Actual: { latte: 4.5, mocha: 3.5, cortado: 3 })
|
1005
1005
|
end
|
1006
1006
|
}
|
1007
1007
|
|
@@ -1009,11 +1009,11 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1009
1009
|
|
1010
1010
|
#{
|
1011
1011
|
colored do
|
1012
|
-
plain_line
|
1013
|
-
plain_line
|
1014
|
-
|
1015
|
-
|
1016
|
-
plain_line
|
1012
|
+
plain_line %( {)
|
1013
|
+
plain_line %( latte: 4.5,)
|
1014
|
+
actual_line %(+ mocha: 3.5,)
|
1015
|
+
actual_line %(+ cortado: 3)
|
1016
|
+
plain_line %( })
|
1017
1017
|
end
|
1018
1018
|
}
|
1019
1019
|
STR
|
@@ -1034,8 +1034,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1034
1034
|
|
1035
1035
|
#{
|
1036
1036
|
colored do
|
1037
|
-
|
1038
|
-
|
1037
|
+
expected_line %(Expected: { latte: 4.5, mocha: 3.5, cortado: 3 })
|
1038
|
+
actual_line %( Actual: { latte: 4.5 })
|
1039
1039
|
end
|
1040
1040
|
}
|
1041
1041
|
|
@@ -1043,11 +1043,11 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1043
1043
|
|
1044
1044
|
#{
|
1045
1045
|
colored do
|
1046
|
-
plain_line
|
1047
|
-
plain_line
|
1048
|
-
|
1049
|
-
|
1050
|
-
plain_line
|
1046
|
+
plain_line %( {)
|
1047
|
+
plain_line %( latte: 4.5)
|
1048
|
+
expected_line %(- mocha: 3.5,)
|
1049
|
+
expected_line %(- cortado: 3)
|
1050
|
+
plain_line %( })
|
1051
1051
|
end
|
1052
1052
|
}
|
1053
1053
|
STR
|
@@ -1056,6 +1056,162 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1056
1056
|
end
|
1057
1057
|
end
|
1058
1058
|
|
1059
|
+
context "given two equal-size, one-dimensional hashes where there is a mixture of missing and extra keys in relatively the same order" do
|
1060
|
+
context "and the actual value is in relatively the same order as the expected" do
|
1061
|
+
it "preserves the order of the keys as they are defined" do
|
1062
|
+
actual_output = described_class.call(
|
1063
|
+
expected: {
|
1064
|
+
listed_count: 37_009,
|
1065
|
+
created_at: "Tue Jan 13 19:28:24 +0000 2009",
|
1066
|
+
favourites_count: 38,
|
1067
|
+
geo_enabled: false,
|
1068
|
+
verified: true,
|
1069
|
+
statuses_count: 273_860,
|
1070
|
+
media_count: 51_044,
|
1071
|
+
contributors_enabled: false,
|
1072
|
+
profile_background_color: "FFF1E0",
|
1073
|
+
profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png",
|
1074
|
+
profile_background_tile: false,
|
1075
|
+
profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",
|
1076
|
+
profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",
|
1077
|
+
profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592",
|
1078
|
+
},
|
1079
|
+
actual: {
|
1080
|
+
listed_count: 37_009,
|
1081
|
+
created_at: "Tue Jan 13 19:28:24 +0000 2009",
|
1082
|
+
favourites_count: 38,
|
1083
|
+
utc_offset: nil,
|
1084
|
+
time_zone: nil,
|
1085
|
+
statuses_count: 273_860,
|
1086
|
+
media_count: 51_044,
|
1087
|
+
contributors_enabled: false,
|
1088
|
+
is_translator: false,
|
1089
|
+
is_translation_enabled: false,
|
1090
|
+
profile_background_color: "FFF1E0",
|
1091
|
+
profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png",
|
1092
|
+
profile_background_tile: false,
|
1093
|
+
profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592",
|
1094
|
+
}
|
1095
|
+
)
|
1096
|
+
|
1097
|
+
expected_output = <<~STR.strip
|
1098
|
+
Differing hashes.
|
1099
|
+
|
1100
|
+
#{
|
1101
|
+
colored do
|
1102
|
+
expected_line %(Expected: { listed_count: 37009, created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, geo_enabled: false, verified: true, statuses_count: 273860, media_count: 51044, contributors_enabled: false, profile_background_color: "FFF1E0", profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png", profile_background_tile: false, profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592" })
|
1103
|
+
actual_line %( Actual: { listed_count: 37009, created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, utc_offset: nil, time_zone: nil, statuses_count: 273860, media_count: 51044, contributors_enabled: false, is_translator: false, is_translation_enabled: false, profile_background_color: "FFF1E0", profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png", profile_background_tile: false, profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592" })
|
1104
|
+
end
|
1105
|
+
}
|
1106
|
+
|
1107
|
+
Diff:
|
1108
|
+
|
1109
|
+
#{
|
1110
|
+
colored do
|
1111
|
+
plain_line %( {)
|
1112
|
+
plain_line %( listed_count: 37009,)
|
1113
|
+
plain_line %( created_at: "Tue Jan 13 19:28:24 +0000 2009",)
|
1114
|
+
plain_line %( favourites_count: 38,)
|
1115
|
+
expected_line %(- geo_enabled: false,)
|
1116
|
+
expected_line %(- verified: true,)
|
1117
|
+
actual_line %(+ utc_offset: nil,)
|
1118
|
+
actual_line %(+ time_zone: nil,)
|
1119
|
+
plain_line %( statuses_count: 273860,)
|
1120
|
+
plain_line %( media_count: 51044,)
|
1121
|
+
plain_line %( contributors_enabled: false,)
|
1122
|
+
actual_line %(+ is_translator: false,)
|
1123
|
+
actual_line %(+ is_translation_enabled: false,)
|
1124
|
+
plain_line %( profile_background_color: "FFF1E0",)
|
1125
|
+
plain_line %( profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png",)
|
1126
|
+
plain_line %( profile_background_tile: false,)
|
1127
|
+
expected_line %(- profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",)
|
1128
|
+
expected_line %(- profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",)
|
1129
|
+
plain_line %( profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592")
|
1130
|
+
plain_line %( })
|
1131
|
+
end
|
1132
|
+
}
|
1133
|
+
STR
|
1134
|
+
|
1135
|
+
expect(actual_output).to eq(expected_output)
|
1136
|
+
end
|
1137
|
+
end
|
1138
|
+
|
1139
|
+
context "and the actual value is in a different order than the expected" do
|
1140
|
+
it "preserves the order of the keys as they are defined" do
|
1141
|
+
actual_output = described_class.call(
|
1142
|
+
expected: {
|
1143
|
+
created_at: "Tue Jan 13 19:28:24 +0000 2009",
|
1144
|
+
favourites_count: 38,
|
1145
|
+
geo_enabled: false,
|
1146
|
+
verified: true,
|
1147
|
+
media_count: 51_044,
|
1148
|
+
statuses_count: 273_860,
|
1149
|
+
contributors_enabled: false,
|
1150
|
+
profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png",
|
1151
|
+
profile_background_color: "FFF1E0",
|
1152
|
+
profile_background_tile: false,
|
1153
|
+
profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",
|
1154
|
+
listed_count: 37_009,
|
1155
|
+
profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592",
|
1156
|
+
},
|
1157
|
+
actual: {
|
1158
|
+
listed_count: 37_009,
|
1159
|
+
created_at: "Tue Jan 13 19:28:24 +0000 2009",
|
1160
|
+
favourites_count: 38,
|
1161
|
+
utc_offset: nil,
|
1162
|
+
statuses_count: 273_860,
|
1163
|
+
media_count: 51_044,
|
1164
|
+
contributors_enabled: false,
|
1165
|
+
is_translator: false,
|
1166
|
+
is_translation_enabled: false,
|
1167
|
+
profile_background_color: "FFF1E0",
|
1168
|
+
profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png",
|
1169
|
+
profile_background_tile: false,
|
1170
|
+
profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592",
|
1171
|
+
}
|
1172
|
+
)
|
1173
|
+
|
1174
|
+
expected_output = <<~STR.strip
|
1175
|
+
Differing hashes.
|
1176
|
+
|
1177
|
+
#{
|
1178
|
+
colored do
|
1179
|
+
expected_line %(Expected: { created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, geo_enabled: false, verified: true, media_count: 51044, statuses_count: 273860, contributors_enabled: false, profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png", profile_background_color: "FFF1E0", profile_background_tile: false, profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", listed_count: 37009, profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592" })
|
1180
|
+
actual_line %( Actual: { listed_count: 37009, created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, utc_offset: nil, statuses_count: 273860, media_count: 51044, contributors_enabled: false, is_translator: false, is_translation_enabled: false, profile_background_color: "FFF1E0", profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png", profile_background_tile: false, profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592" })
|
1181
|
+
end
|
1182
|
+
}
|
1183
|
+
|
1184
|
+
Diff:
|
1185
|
+
|
1186
|
+
#{
|
1187
|
+
colored do
|
1188
|
+
plain_line %( {)
|
1189
|
+
plain_line %( listed_count: 37009,)
|
1190
|
+
plain_line %( created_at: "Tue Jan 13 19:28:24 +0000 2009",)
|
1191
|
+
plain_line %( favourites_count: 38,)
|
1192
|
+
expected_line %(- geo_enabled: false,)
|
1193
|
+
expected_line %(- verified: true,)
|
1194
|
+
actual_line %(+ utc_offset: nil,)
|
1195
|
+
plain_line %( statuses_count: 273860,)
|
1196
|
+
plain_line %( media_count: 51044,)
|
1197
|
+
plain_line %( contributors_enabled: false,)
|
1198
|
+
actual_line %(+ is_translator: false,)
|
1199
|
+
actual_line %(+ is_translation_enabled: false,)
|
1200
|
+
plain_line %( profile_background_color: "FFF1E0",)
|
1201
|
+
plain_line %( profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png",)
|
1202
|
+
plain_line %( profile_background_tile: false,)
|
1203
|
+
expected_line %(- profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",)
|
1204
|
+
plain_line %( profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592")
|
1205
|
+
plain_line %( })
|
1206
|
+
end
|
1207
|
+
}
|
1208
|
+
STR
|
1209
|
+
|
1210
|
+
expect(actual_output).to eq(expected_output)
|
1211
|
+
end
|
1212
|
+
end
|
1213
|
+
end
|
1214
|
+
|
1059
1215
|
context "given two hashes containing arrays with differing values" do
|
1060
1216
|
it "returns a message along with the diff" do
|
1061
1217
|
actual_output = described_class.call(
|
@@ -1076,8 +1232,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1076
1232
|
|
1077
1233
|
#{
|
1078
1234
|
colored do
|
1079
|
-
|
1080
|
-
|
1235
|
+
expected_line %(Expected: { name: "Elliot", interests: ["music", "football", "programming"], age: 30 })
|
1236
|
+
actual_line %( Actual: { name: "Elliot", interests: ["music", "travel", "programming"], age: 30 })
|
1081
1237
|
end
|
1082
1238
|
}
|
1083
1239
|
|
@@ -1085,16 +1241,16 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1085
1241
|
|
1086
1242
|
#{
|
1087
1243
|
colored do
|
1088
|
-
plain_line
|
1089
|
-
plain_line
|
1090
|
-
plain_line
|
1091
|
-
plain_line
|
1092
|
-
|
1093
|
-
|
1094
|
-
plain_line
|
1095
|
-
plain_line
|
1096
|
-
plain_line
|
1097
|
-
plain_line
|
1244
|
+
plain_line %( {)
|
1245
|
+
plain_line %( name: "Elliot",)
|
1246
|
+
plain_line %( interests: [)
|
1247
|
+
plain_line %( "music",)
|
1248
|
+
expected_line %(- "football",)
|
1249
|
+
actual_line %(+ "travel",)
|
1250
|
+
plain_line %( "programming")
|
1251
|
+
plain_line %( ],)
|
1252
|
+
plain_line %( age: 30)
|
1253
|
+
plain_line %( })
|
1098
1254
|
end
|
1099
1255
|
}
|
1100
1256
|
STR
|
@@ -1131,8 +1287,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1131
1287
|
|
1132
1288
|
#{
|
1133
1289
|
colored do
|
1134
|
-
|
1135
|
-
|
1290
|
+
expected_line %(Expected: { check_spelling: true, substitutions: { "YOLO" => "You only live once", "BRB" => "Buns, ribs, and bacon", "YMMV" => "Your mileage may vary" }, check_grammar: false })
|
1291
|
+
actual_line %( Actual: { check_spelling: true, substitutions: { "YOLO" => "You only live once", "BRB" => "Be right back", "YMMV" => "Your mileage may vary" }, check_grammar: false })
|
1136
1292
|
end
|
1137
1293
|
}
|
1138
1294
|
|
@@ -1140,16 +1296,16 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1140
1296
|
|
1141
1297
|
#{
|
1142
1298
|
colored do
|
1143
|
-
plain_line
|
1144
|
-
plain_line
|
1145
|
-
plain_line
|
1146
|
-
plain_line
|
1147
|
-
|
1148
|
-
|
1149
|
-
plain_line
|
1150
|
-
plain_line
|
1151
|
-
plain_line
|
1152
|
-
plain_line
|
1299
|
+
plain_line %( {)
|
1300
|
+
plain_line %( check_spelling: true,)
|
1301
|
+
plain_line %( substitutions: {)
|
1302
|
+
plain_line %( "YOLO" => "You only live once",)
|
1303
|
+
expected_line %(- "BRB" => "Buns, ribs, and bacon",)
|
1304
|
+
actual_line %(+ "BRB" => "Be right back",)
|
1305
|
+
plain_line %( "YMMV" => "Your mileage may vary")
|
1306
|
+
plain_line %( },)
|
1307
|
+
plain_line %( check_grammar: false)
|
1308
|
+
plain_line %( })
|
1153
1309
|
end
|
1154
1310
|
}
|
1155
1311
|
STR
|
@@ -1178,8 +1334,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1178
1334
|
|
1179
1335
|
#{
|
1180
1336
|
colored do
|
1181
|
-
|
1182
|
-
|
1337
|
+
expected_line %(Expected: { order_id: 1234, person: #<SuperDiff::Test::Person name: "Marty", age: 18>, amount: 35000 })
|
1338
|
+
actual_line %( Actual: { order_id: 1234, person: #<SuperDiff::Test::Person name: "Doc", age: 50>, amount: 35000 })
|
1183
1339
|
end
|
1184
1340
|
}
|
1185
1341
|
|
@@ -1187,16 +1343,16 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1187
1343
|
|
1188
1344
|
#{
|
1189
1345
|
colored do
|
1190
|
-
plain_line
|
1191
|
-
plain_line
|
1192
|
-
plain_line
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
plain_line
|
1198
|
-
plain_line
|
1199
|
-
plain_line
|
1346
|
+
plain_line %( {)
|
1347
|
+
plain_line %( order_id: 1234,)
|
1348
|
+
plain_line %( person: #<SuperDiff::Test::Person {)
|
1349
|
+
expected_line %(- name: "Marty",)
|
1350
|
+
actual_line %(+ name: "Doc",)
|
1351
|
+
expected_line %(- age: 18)
|
1352
|
+
actual_line %(+ age: 50)
|
1353
|
+
plain_line %( }>,)
|
1354
|
+
plain_line %( amount: 35000)
|
1355
|
+
plain_line %( })
|
1200
1356
|
end
|
1201
1357
|
}
|
1202
1358
|
STR
|
@@ -1253,8 +1409,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1253
1409
|
|
1254
1410
|
#{
|
1255
1411
|
colored do
|
1256
|
-
|
1257
|
-
|
1412
|
+
expected_line %(Expected: { customer: { name: "Marty McFly", shipping_address: { line_1: "123 Main St.", city: "Hill Valley", state: "CA", zip: "90382" } }, items: [{ name: "Fender Stratocaster", cost: 100000, options: ["red", "blue", "green"] }, { name: "Chevy 4x4" }] })
|
1413
|
+
actual_line %( Actual: { customer: { name: "Marty McFly, Jr.", shipping_address: { line_1: "456 Ponderosa Ct.", city: "Hill Valley", state: "CA", zip: "90382" } }, items: [{ name: "Fender Stratocaster", cost: 100000, options: ["red", "blue", "green"] }, { name: "Mattel Hoverboard" }] })
|
1258
1414
|
end
|
1259
1415
|
}
|
1260
1416
|
|
@@ -1262,34 +1418,34 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1262
1418
|
|
1263
1419
|
#{
|
1264
1420
|
colored do
|
1265
|
-
plain_line
|
1266
|
-
plain_line
|
1267
|
-
|
1268
|
-
|
1269
|
-
plain_line
|
1270
|
-
|
1271
|
-
|
1272
|
-
plain_line
|
1273
|
-
plain_line
|
1274
|
-
plain_line
|
1275
|
-
plain_line
|
1276
|
-
plain_line
|
1277
|
-
plain_line
|
1278
|
-
plain_line
|
1279
|
-
plain_line
|
1280
|
-
plain_line
|
1281
|
-
plain_line
|
1282
|
-
plain_line
|
1283
|
-
plain_line
|
1284
|
-
plain_line
|
1285
|
-
plain_line
|
1286
|
-
plain_line
|
1287
|
-
plain_line
|
1288
|
-
|
1289
|
-
|
1290
|
-
plain_line
|
1291
|
-
plain_line
|
1292
|
-
plain_line
|
1421
|
+
plain_line %( {)
|
1422
|
+
plain_line %( customer: {)
|
1423
|
+
expected_line %(- name: "Marty McFly",)
|
1424
|
+
actual_line %(+ name: "Marty McFly, Jr.",)
|
1425
|
+
plain_line %( shipping_address: {)
|
1426
|
+
expected_line %(- line_1: "123 Main St.",)
|
1427
|
+
actual_line %(+ line_1: "456 Ponderosa Ct.",)
|
1428
|
+
plain_line %( city: "Hill Valley",)
|
1429
|
+
plain_line %( state: "CA",)
|
1430
|
+
plain_line %( zip: "90382")
|
1431
|
+
plain_line %( })
|
1432
|
+
plain_line %( },)
|
1433
|
+
plain_line %( items: [)
|
1434
|
+
plain_line %( {)
|
1435
|
+
plain_line %( name: "Fender Stratocaster",)
|
1436
|
+
plain_line %( cost: 100000,)
|
1437
|
+
plain_line %( options: [)
|
1438
|
+
plain_line %( "red",)
|
1439
|
+
plain_line %( "blue",)
|
1440
|
+
plain_line %( "green")
|
1441
|
+
plain_line %( ])
|
1442
|
+
plain_line %( },)
|
1443
|
+
plain_line %( {)
|
1444
|
+
expected_line %(- name: "Chevy 4x4")
|
1445
|
+
actual_line %(+ name: "Mattel Hoverboard")
|
1446
|
+
plain_line %( })
|
1447
|
+
plain_line %( ])
|
1448
|
+
plain_line %( })
|
1293
1449
|
end
|
1294
1450
|
}
|
1295
1451
|
STR
|
@@ -1324,8 +1480,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1324
1480
|
|
1325
1481
|
#{
|
1326
1482
|
colored do
|
1327
|
-
|
1328
|
-
|
1483
|
+
expected_line %(Expected: #<SuperDiff::Test::Person name: "Marty", age: 18>)
|
1484
|
+
actual_line %( Actual: #<SuperDiff::Test::Person name: "Doc", age: 50>)
|
1329
1485
|
end
|
1330
1486
|
}
|
1331
1487
|
|
@@ -1333,12 +1489,12 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1333
1489
|
|
1334
1490
|
#{
|
1335
1491
|
colored do
|
1336
|
-
plain_line
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
plain_line
|
1492
|
+
plain_line %( #<SuperDiff::Test::Person {)
|
1493
|
+
expected_line %(- name: "Marty",)
|
1494
|
+
actual_line %(+ name: "Doc",)
|
1495
|
+
expected_line %(- age: 18)
|
1496
|
+
actual_line %(+ age: 50)
|
1497
|
+
plain_line %( }>)
|
1342
1498
|
end
|
1343
1499
|
}
|
1344
1500
|
STR
|
@@ -1375,13 +1531,13 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1375
1531
|
if SuperDiff::Test.jruby?
|
1376
1532
|
# Source: <https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/RubyBasicObject.java>
|
1377
1533
|
colored do
|
1378
|
-
|
1379
|
-
|
1534
|
+
expected_line %(Expected: #<SuperDiff::Test::Player:#{SuperDiff::Test.object_id_hex(expected)} @inventory=["flatline", "purple body shield"], @character="mirage", @handle="martymcfly", @ultimate=0.8, @shields=0.6, @health=0.3>)
|
1535
|
+
actual_line %( Actual: #<SuperDiff::Test::Player:#{SuperDiff::Test.object_id_hex(actual)} @inventory=["wingman", "mastiff"], @character="lifeline", @handle="docbrown", @ultimate=0.8, @shields=0.6, @health=0.3>)
|
1380
1536
|
end
|
1381
1537
|
else
|
1382
1538
|
colored do
|
1383
|
-
|
1384
|
-
|
1539
|
+
expected_line %(Expected: #<SuperDiff::Test::Player:#{SuperDiff::Test.object_id_hex(expected)} @handle="martymcfly", @character="mirage", @inventory=["flatline", "purple body shield"], @shields=0.6, @health=0.3, @ultimate=0.8>)
|
1540
|
+
actual_line %( Actual: #<SuperDiff::Test::Player:#{SuperDiff::Test.object_id_hex(actual)} @handle="docbrown", @character="lifeline", @inventory=["wingman", "mastiff"], @shields=0.6, @health=0.3, @ultimate=0.8>)
|
1385
1541
|
end
|
1386
1542
|
end
|
1387
1543
|
}
|
@@ -1390,21 +1546,21 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1390
1546
|
|
1391
1547
|
#{
|
1392
1548
|
colored do
|
1393
|
-
plain_line
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
plain_line
|
1399
|
-
plain_line
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
plain_line
|
1405
|
-
plain_line
|
1406
|
-
plain_line
|
1407
|
-
plain_line
|
1549
|
+
plain_line %( #<SuperDiff::Test::Player {)
|
1550
|
+
expected_line %(- @character="mirage",)
|
1551
|
+
actual_line %(+ @character="lifeline",)
|
1552
|
+
expected_line %(- @handle="martymcfly",)
|
1553
|
+
actual_line %(+ @handle="docbrown",)
|
1554
|
+
plain_line %( @health=0.3,)
|
1555
|
+
plain_line %( @inventory=[)
|
1556
|
+
expected_line %(- "flatline",)
|
1557
|
+
actual_line %(+ "wingman",)
|
1558
|
+
expected_line %(- "purple body shield")
|
1559
|
+
actual_line %(+ "mastiff")
|
1560
|
+
plain_line %( ],)
|
1561
|
+
plain_line %( @shields=0.6,)
|
1562
|
+
plain_line %( @ultimate=0.8)
|
1563
|
+
plain_line %( }>)
|
1408
1564
|
end
|
1409
1565
|
}
|
1410
1566
|
STR
|
@@ -1432,8 +1588,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1432
1588
|
|
1433
1589
|
#{
|
1434
1590
|
colored do
|
1435
|
-
|
1436
|
-
|
1591
|
+
expected_line %(Expected: #<SuperDiff::Test::Person name: "Marty", age: 31>)
|
1592
|
+
actual_line %( Actual: #<SuperDiff::Test::Customer name: "Doc", shipping_address: :some_shipping_address, phone: "1234567890">)
|
1437
1593
|
end
|
1438
1594
|
}
|
1439
1595
|
STR
|
@@ -1466,13 +1622,13 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1466
1622
|
if SuperDiff::Test.jruby?
|
1467
1623
|
# Source: <https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/RubyBasicObject.java>
|
1468
1624
|
colored do
|
1469
|
-
|
1470
|
-
|
1625
|
+
expected_line %(Expected: #<SuperDiff::Test::Item:#{SuperDiff::Test.object_id_hex(expected)} @name="camera", @quantity=3>)
|
1626
|
+
actual_line %( Actual: #<SuperDiff::Test::Player:#{SuperDiff::Test.object_id_hex(actual)} @inventory=["sword"], @character="Jon", @handle="mcmire", @ultimate=true, @shields=11.4, @health=4>)
|
1471
1627
|
end
|
1472
1628
|
else
|
1473
1629
|
colored do
|
1474
|
-
|
1475
|
-
|
1630
|
+
expected_line %(Expected: #<SuperDiff::Test::Item:#{SuperDiff::Test.object_id_hex(expected)} @name="camera", @quantity=3>)
|
1631
|
+
actual_line %( Actual: #<SuperDiff::Test::Player:#{SuperDiff::Test.object_id_hex(actual)} @handle="mcmire", @character="Jon", @inventory=["sword"], @shields=11.4, @health=4, @ultimate=true>)
|
1476
1632
|
end
|
1477
1633
|
end
|
1478
1634
|
}
|
@@ -1495,8 +1651,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1495
1651
|
|
1496
1652
|
#{
|
1497
1653
|
colored do
|
1498
|
-
|
1499
|
-
|
1654
|
+
expected_line %(Expected: ["a", ∙∙∙, "b", "c"])
|
1655
|
+
actual_line %( Actual: ["a", "x", "b", "c"])
|
1500
1656
|
end
|
1501
1657
|
}
|
1502
1658
|
|
@@ -1504,13 +1660,13 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1504
1660
|
|
1505
1661
|
#{
|
1506
1662
|
colored do
|
1507
|
-
plain_line
|
1508
|
-
plain_line
|
1509
|
-
|
1510
|
-
|
1511
|
-
plain_line
|
1512
|
-
plain_line
|
1513
|
-
plain_line
|
1663
|
+
plain_line %( [)
|
1664
|
+
plain_line %( "a",)
|
1665
|
+
expected_line %(- ∙∙∙,)
|
1666
|
+
actual_line %(+ "x",)
|
1667
|
+
plain_line %( "b",)
|
1668
|
+
plain_line %( "c")
|
1669
|
+
plain_line %( ])
|
1514
1670
|
end
|
1515
1671
|
}
|
1516
1672
|
STR
|
@@ -1532,8 +1688,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1532
1688
|
|
1533
1689
|
#{
|
1534
1690
|
colored do
|
1535
|
-
|
1536
|
-
|
1691
|
+
expected_line %(Expected: ["a", "x", "b", "c"])
|
1692
|
+
actual_line %( Actual: ["a", ∙∙∙, "b", "c"])
|
1537
1693
|
end
|
1538
1694
|
}
|
1539
1695
|
|
@@ -1541,13 +1697,13 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1541
1697
|
|
1542
1698
|
#{
|
1543
1699
|
colored do
|
1544
|
-
plain_line
|
1545
|
-
plain_line
|
1546
|
-
|
1547
|
-
|
1548
|
-
plain_line
|
1549
|
-
plain_line
|
1550
|
-
plain_line
|
1700
|
+
plain_line %( [)
|
1701
|
+
plain_line %( "a",)
|
1702
|
+
expected_line %(- "x",)
|
1703
|
+
actual_line %(+ ∙∙∙,)
|
1704
|
+
plain_line %( "b",)
|
1705
|
+
plain_line %( "c")
|
1706
|
+
plain_line %( ])
|
1551
1707
|
end
|
1552
1708
|
}
|
1553
1709
|
STR
|
@@ -1569,8 +1725,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1569
1725
|
|
1570
1726
|
#{
|
1571
1727
|
colored do
|
1572
|
-
|
1573
|
-
|
1728
|
+
expected_line %(Expected: { foo: ["a", "x", "b", "c"] })
|
1729
|
+
actual_line %( Actual: { foo: ["a", ∙∙∙, "b", "c"] })
|
1574
1730
|
end
|
1575
1731
|
}
|
1576
1732
|
|
@@ -1578,15 +1734,15 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1578
1734
|
|
1579
1735
|
#{
|
1580
1736
|
colored do
|
1581
|
-
plain_line
|
1582
|
-
plain_line
|
1583
|
-
plain_line
|
1584
|
-
|
1585
|
-
|
1586
|
-
plain_line
|
1587
|
-
plain_line
|
1588
|
-
plain_line
|
1589
|
-
plain_line
|
1737
|
+
plain_line %( {)
|
1738
|
+
plain_line %( foo: [)
|
1739
|
+
plain_line %( "a",)
|
1740
|
+
expected_line %(- "x",)
|
1741
|
+
actual_line %(+ ∙∙∙,)
|
1742
|
+
plain_line %( "b",)
|
1743
|
+
plain_line %( "c")
|
1744
|
+
plain_line %( ])
|
1745
|
+
plain_line %( })
|
1590
1746
|
end
|
1591
1747
|
}
|
1592
1748
|
STR
|
@@ -1608,8 +1764,8 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1608
1764
|
|
1609
1765
|
#{
|
1610
1766
|
colored do
|
1611
|
-
|
1612
|
-
|
1767
|
+
expected_line %(Expected: { foo: ["a", "x", "b", "c"] })
|
1768
|
+
actual_line %( Actual: { foo: ["a", ∙∙∙, "b", "c"] })
|
1613
1769
|
end
|
1614
1770
|
}
|
1615
1771
|
|
@@ -1617,15 +1773,15 @@ RSpec.describe SuperDiff::EqualityMatcher do
|
|
1617
1773
|
|
1618
1774
|
#{
|
1619
1775
|
colored do
|
1620
|
-
plain_line
|
1621
|
-
plain_line
|
1622
|
-
plain_line
|
1623
|
-
|
1624
|
-
|
1625
|
-
plain_line
|
1626
|
-
plain_line
|
1627
|
-
plain_line
|
1628
|
-
plain_line
|
1776
|
+
plain_line %( {)
|
1777
|
+
plain_line %( foo: [)
|
1778
|
+
plain_line %( "a",)
|
1779
|
+
expected_line %(- "x",)
|
1780
|
+
actual_line %(+ ∙∙∙,)
|
1781
|
+
plain_line %( "b",)
|
1782
|
+
plain_line %( "c")
|
1783
|
+
plain_line %( ])
|
1784
|
+
plain_line %( })
|
1629
1785
|
end
|
1630
1786
|
}
|
1631
1787
|
STR
|