super_diff 0.5.3 → 0.6.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 -19
- data/lib/super_diff.rb +1 -7
- data/lib/super_diff/colorized_document_extensions.rb +4 -4
- data/lib/super_diff/configuration.rb +32 -22
- data/lib/super_diff/csi.rb +2 -1
- data/lib/super_diff/diff_formatters/collection.rb +1 -1
- data/lib/super_diff/diff_formatters/multiline_string.rb +4 -4
- data/lib/super_diff/equality_matchers/array.rb +2 -2
- data/lib/super_diff/equality_matchers/default.rb +2 -2
- data/lib/super_diff/equality_matchers/hash.rb +2 -2
- data/lib/super_diff/equality_matchers/multiline_string.rb +2 -2
- 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/gem_version.rb +45 -0
- data/lib/super_diff/rspec.rb +4 -0
- 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 +22 -13
- data/lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb +12 -1
- data/lib/super_diff/version.rb +1 -1
- data/spec/examples.txt +393 -5
- 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 +129 -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 +119 -119
- 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 +5 -5
- data/spec/spec_helper.rb +22 -13
- data/spec/support/integration/helpers.rb +6 -2
- data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +1 -1
- data/spec/support/integration/test_programs/base.rb +2 -0
- 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 +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_matchers/main_spec.rb +403 -403
- data/super_diff.gemspec +1 -1
- metadata +11 -3
@@ -13,11 +13,11 @@ RSpec.describe "Integration with RSpec's #be_truthy matcher", type: :integration
|
|
13
13
|
snippet: %|expect(nil).to be_truthy|,
|
14
14
|
expectation: proc {
|
15
15
|
line do
|
16
|
-
plain
|
17
|
-
|
18
|
-
plain
|
19
|
-
|
20
|
-
plain
|
16
|
+
plain %|Expected |
|
17
|
+
actual %|nil|
|
18
|
+
plain %| to be |
|
19
|
+
expected %|truthy|
|
20
|
+
plain %|.|
|
21
21
|
end
|
22
22
|
},
|
23
23
|
)
|
@@ -40,11 +40,11 @@ RSpec.describe "Integration with RSpec's #be_truthy matcher", type: :integration
|
|
40
40
|
snippet: %|expect(true).not_to be_truthy|,
|
41
41
|
expectation: proc {
|
42
42
|
line do
|
43
|
-
plain
|
44
|
-
|
45
|
-
plain
|
46
|
-
|
47
|
-
plain
|
43
|
+
plain %|Expected |
|
44
|
+
actual %|true|
|
45
|
+
plain %| not to be |
|
46
|
+
expected %|truthy|
|
47
|
+
plain %|.|
|
48
48
|
end
|
49
49
|
},
|
50
50
|
)
|
@@ -6,7 +6,7 @@ RSpec.describe "Integration with RSpec's #contain_exactly matcher", type: :integ
|
|
6
6
|
as_both_colored_and_uncolored do |color_enabled|
|
7
7
|
snippet = <<~TEST.strip
|
8
8
|
expected = ["Einie", "Marty"]
|
9
|
-
actual
|
9
|
+
actual = ["Marty", "Jennifer", "Doc"]
|
10
10
|
expect(actual).to contain_exactly(*expected)
|
11
11
|
TEST
|
12
12
|
program = make_plain_test_program(
|
@@ -19,22 +19,22 @@ RSpec.describe "Integration with RSpec's #contain_exactly matcher", type: :integ
|
|
19
19
|
snippet: %|expect(actual).to contain_exactly(*expected)|,
|
20
20
|
expectation: proc {
|
21
21
|
line do
|
22
|
-
plain
|
23
|
-
|
24
|
-
plain
|
25
|
-
|
26
|
-
plain
|
27
|
-
|
28
|
-
plain
|
22
|
+
plain %|Expected |
|
23
|
+
actual %|["Marty", "Jennifer", "Doc"]|
|
24
|
+
plain %| to contain exactly |
|
25
|
+
expected %|"Einie"|
|
26
|
+
plain %| and |
|
27
|
+
expected %|"Marty"|
|
28
|
+
plain %|.|
|
29
29
|
end
|
30
30
|
},
|
31
31
|
diff: proc {
|
32
|
-
plain_line
|
33
|
-
plain_line
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
plain_line
|
32
|
+
plain_line %| [|
|
33
|
+
plain_line %| "Marty",|
|
34
|
+
actual_line %|+ "Jennifer",|
|
35
|
+
actual_line %|+ "Doc",|
|
36
|
+
expected_line %|- "Einie"|
|
37
|
+
plain_line %| ]|
|
38
38
|
},
|
39
39
|
)
|
40
40
|
|
@@ -60,13 +60,13 @@ RSpec.describe "Integration with RSpec's #contain_exactly matcher", type: :integ
|
|
60
60
|
snippet: %|expect(values).not_to contain_exactly(*values)|,
|
61
61
|
expectation: proc {
|
62
62
|
line do
|
63
|
-
plain
|
64
|
-
|
65
|
-
plain
|
66
|
-
|
67
|
-
plain
|
68
|
-
|
69
|
-
plain
|
63
|
+
plain %|Expected |
|
64
|
+
actual %|["Einie", "Marty"]|
|
65
|
+
plain %| not to contain exactly |
|
66
|
+
expected %|"Einie"|
|
67
|
+
plain %| and |
|
68
|
+
expected %|"Marty"|
|
69
|
+
plain %|.|
|
70
70
|
end
|
71
71
|
},
|
72
72
|
)
|
@@ -90,7 +90,7 @@ RSpec.describe "Integration with RSpec's #contain_exactly matcher", type: :integ
|
|
90
90
|
"George McFly",
|
91
91
|
"Lorraine McFly"
|
92
92
|
]
|
93
|
-
actual
|
93
|
+
actual = [
|
94
94
|
"Marty McFly",
|
95
95
|
"Doc Brown",
|
96
96
|
"Einie",
|
@@ -108,32 +108,32 @@ RSpec.describe "Integration with RSpec's #contain_exactly matcher", type: :integ
|
|
108
108
|
snippet: %|expect(actual).to contain_exactly(*expected)|,
|
109
109
|
expectation: proc {
|
110
110
|
line do
|
111
|
-
plain
|
112
|
-
|
111
|
+
plain %| Expected |
|
112
|
+
actual %|["Marty McFly", "Doc Brown", "Einie", "Lorraine McFly"]|
|
113
113
|
end
|
114
114
|
|
115
115
|
line do
|
116
|
-
plain
|
117
|
-
|
118
|
-
plain
|
119
|
-
|
120
|
-
plain
|
121
|
-
|
122
|
-
plain
|
123
|
-
|
124
|
-
plain
|
125
|
-
|
116
|
+
plain %|to contain exactly |
|
117
|
+
expected %|"Doc Brown"|
|
118
|
+
plain %|, |
|
119
|
+
expected %|"Marty McFly"|
|
120
|
+
plain %|, |
|
121
|
+
expected %|"Biff Tannen"|
|
122
|
+
plain %|, |
|
123
|
+
expected %|"George McFly"|
|
124
|
+
plain %| and |
|
125
|
+
expected %|"Lorraine McFly"|
|
126
126
|
end
|
127
127
|
},
|
128
128
|
diff: proc {
|
129
|
-
plain_line
|
130
|
-
plain_line
|
131
|
-
plain_line
|
132
|
-
plain_line
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
plain_line
|
129
|
+
plain_line %| [|
|
130
|
+
plain_line %| "Marty McFly",|
|
131
|
+
plain_line %| "Doc Brown",|
|
132
|
+
plain_line %| "Lorraine McFly",|
|
133
|
+
actual_line %|+ "Einie",|
|
134
|
+
expected_line %|- "Biff Tannen",|
|
135
|
+
expected_line %|- "George McFly"|
|
136
|
+
plain_line %| ]|
|
137
137
|
},
|
138
138
|
)
|
139
139
|
|
@@ -165,19 +165,19 @@ RSpec.describe "Integration with RSpec's #contain_exactly matcher", type: :integ
|
|
165
165
|
newline_before_expectation: true,
|
166
166
|
expectation: proc {
|
167
167
|
line do
|
168
|
-
plain
|
169
|
-
|
168
|
+
plain %| Expected |
|
169
|
+
actual %|["Marty McFly", "Doc Brown", "Einie", "Lorraine McFly"]|
|
170
170
|
end
|
171
171
|
|
172
172
|
line do
|
173
|
-
plain
|
174
|
-
|
175
|
-
plain
|
176
|
-
|
177
|
-
plain
|
178
|
-
|
179
|
-
plain
|
180
|
-
|
173
|
+
plain %|not to contain exactly |
|
174
|
+
expected %|"Marty McFly"|
|
175
|
+
plain %|, |
|
176
|
+
expected %|"Doc Brown"|
|
177
|
+
plain %|, |
|
178
|
+
expected %|"Einie"|
|
179
|
+
plain %| and |
|
180
|
+
expected %|"Lorraine McFly"|
|
181
181
|
end
|
182
182
|
},
|
183
183
|
)
|
@@ -200,7 +200,7 @@ RSpec.describe "Integration with RSpec's #contain_exactly matcher", type: :integ
|
|
200
200
|
/Georg McFly/,
|
201
201
|
/Lorrain McFly/
|
202
202
|
]
|
203
|
-
actual
|
203
|
+
actual = [
|
204
204
|
"Marty McFly",
|
205
205
|
"Doc Brown",
|
206
206
|
"Einie",
|
@@ -218,33 +218,33 @@ RSpec.describe "Integration with RSpec's #contain_exactly matcher", type: :integ
|
|
218
218
|
snippet: %|expect(actual).to contain_exactly(*expected)|,
|
219
219
|
expectation: proc {
|
220
220
|
line do
|
221
|
-
plain
|
222
|
-
|
221
|
+
plain %| Expected |
|
222
|
+
actual %|["Marty McFly", "Doc Brown", "Einie", "Lorraine McFly"]|
|
223
223
|
end
|
224
224
|
|
225
225
|
line do
|
226
|
-
plain
|
227
|
-
|
228
|
-
plain
|
229
|
-
|
230
|
-
plain
|
231
|
-
|
232
|
-
plain
|
233
|
-
|
234
|
-
plain
|
235
|
-
|
226
|
+
plain %|to contain exactly |
|
227
|
+
expected %|/ Brown$/|
|
228
|
+
plain %|, |
|
229
|
+
expected %|"Marty McFly"|
|
230
|
+
plain %|, |
|
231
|
+
expected %|"Biff Tannen"|
|
232
|
+
plain %|, |
|
233
|
+
expected %|/Georg McFly/|
|
234
|
+
plain %| and |
|
235
|
+
expected %|/Lorrain McFly/|
|
236
236
|
end
|
237
237
|
},
|
238
238
|
diff: proc {
|
239
|
-
plain_line
|
240
|
-
plain_line
|
241
|
-
plain_line
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
plain_line
|
239
|
+
plain_line %| [|
|
240
|
+
plain_line %| "Marty McFly",|
|
241
|
+
plain_line %| "Doc Brown",|
|
242
|
+
actual_line %|+ "Einie",|
|
243
|
+
actual_line %|+ "Lorraine McFly",|
|
244
|
+
expected_line %|- "Biff Tannen",|
|
245
|
+
expected_line %|- /Georg McFly/,|
|
246
|
+
expected_line %|- /Lorrain McFly/|
|
247
|
+
plain_line %| ]|
|
248
248
|
},
|
249
249
|
)
|
250
250
|
|
@@ -277,21 +277,21 @@ RSpec.describe "Integration with RSpec's #contain_exactly matcher", type: :integ
|
|
277
277
|
newline_before_expectation: true,
|
278
278
|
expectation: proc {
|
279
279
|
line do
|
280
|
-
plain
|
281
|
-
|
280
|
+
plain %| Expected |
|
281
|
+
actual %|[/ Brown$/, "Marty McFly", "Biff Tannen", /Georg McFly/, /Lorrain McFly/]|
|
282
282
|
end
|
283
283
|
|
284
284
|
line do
|
285
|
-
plain
|
286
|
-
|
287
|
-
plain
|
288
|
-
|
289
|
-
plain
|
290
|
-
|
291
|
-
plain
|
292
|
-
|
293
|
-
plain
|
294
|
-
|
285
|
+
plain %|not to contain exactly |
|
286
|
+
expected %|/ Brown$/|
|
287
|
+
plain %|, |
|
288
|
+
expected %|"Marty McFly"|
|
289
|
+
plain %|, |
|
290
|
+
expected %|"Biff Tannen"|
|
291
|
+
plain %|, |
|
292
|
+
expected %|/Georg McFly/|
|
293
|
+
plain %| and |
|
294
|
+
expected %|/Lorrain McFly/|
|
295
295
|
end
|
296
296
|
},
|
297
297
|
)
|
@@ -312,7 +312,7 @@ RSpec.describe "Integration with RSpec's #contain_exactly matcher", type: :integ
|
|
312
312
|
a_collection_containing_exactly("zing"),
|
313
313
|
an_object_having_attributes(baz: "qux"),
|
314
314
|
]
|
315
|
-
actual
|
315
|
+
actual = [
|
316
316
|
{ foo: "bar" },
|
317
317
|
double(baz: "qux"),
|
318
318
|
{ blargh: "riddle" }
|
@@ -329,32 +329,32 @@ RSpec.describe "Integration with RSpec's #contain_exactly matcher", type: :integ
|
|
329
329
|
snippet: %|expect(actual).to contain_exactly(*expected)|,
|
330
330
|
expectation: proc {
|
331
331
|
line do
|
332
|
-
plain
|
333
|
-
|
332
|
+
plain %| Expected |
|
333
|
+
actual %|[{ foo: "bar" }, #<Double (anonymous)>, { blargh: "riddle" }]|
|
334
334
|
end
|
335
335
|
|
336
336
|
line do
|
337
|
-
plain
|
338
|
-
|
339
|
-
plain
|
340
|
-
|
341
|
-
plain
|
342
|
-
|
337
|
+
plain %|to contain exactly |
|
338
|
+
expected %|#<a hash including (foo: "bar")>|
|
339
|
+
plain %|, |
|
340
|
+
expected %|#<a collection containing exactly ("zing")>|
|
341
|
+
plain %| and |
|
342
|
+
expected %|#<an object having attributes (baz: "qux")>|
|
343
343
|
end
|
344
344
|
},
|
345
345
|
diff: proc {
|
346
|
-
plain_line
|
347
|
-
plain_line
|
348
|
-
plain_line
|
349
|
-
plain_line
|
350
|
-
plain_line
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
plain_line
|
346
|
+
plain_line %| [|
|
347
|
+
plain_line %| {|
|
348
|
+
plain_line %| foo: "bar"|
|
349
|
+
plain_line %| },|
|
350
|
+
plain_line %| #<Double (anonymous)>,|
|
351
|
+
actual_line %|+ {|
|
352
|
+
actual_line %|+ blargh: "riddle"|
|
353
|
+
actual_line %|+ },|
|
354
|
+
expected_line %|- #<a collection containing exactly (|
|
355
|
+
expected_line %|- "zing"|
|
356
|
+
expected_line %|- )>|
|
357
|
+
plain_line %| ]|
|
358
358
|
},
|
359
359
|
)
|
360
360
|
|
@@ -12,11 +12,11 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
12
12
|
snippet: snippet,
|
13
13
|
expectation: proc {
|
14
14
|
line do
|
15
|
-
plain
|
16
|
-
|
17
|
-
plain
|
18
|
-
|
19
|
-
plain
|
15
|
+
plain %|Expected |
|
16
|
+
actual %|1|
|
17
|
+
plain %| to eq |
|
18
|
+
expected %|42|
|
19
|
+
plain %|.|
|
20
20
|
end
|
21
21
|
},
|
22
22
|
)
|
@@ -37,11 +37,11 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
37
37
|
snippet: snippet,
|
38
38
|
expectation: proc {
|
39
39
|
line do
|
40
|
-
plain
|
41
|
-
|
42
|
-
plain
|
43
|
-
|
44
|
-
plain
|
40
|
+
plain %|Expected |
|
41
|
+
actual %|42|
|
42
|
+
plain %| not to eq |
|
43
|
+
expected %|42|
|
44
|
+
plain %|.|
|
45
45
|
end
|
46
46
|
},
|
47
47
|
)
|
@@ -67,11 +67,11 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
67
67
|
snippet: snippet,
|
68
68
|
expectation: proc {
|
69
69
|
line do
|
70
|
-
plain
|
71
|
-
|
72
|
-
plain
|
73
|
-
|
74
|
-
plain
|
70
|
+
plain %|Expected |
|
71
|
+
actual %|:bar|
|
72
|
+
plain %| to eq |
|
73
|
+
expected %|:foo|
|
74
|
+
plain %|.|
|
75
75
|
end
|
76
76
|
},
|
77
77
|
)
|
@@ -95,11 +95,11 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
95
95
|
snippet: snippet,
|
96
96
|
expectation: proc {
|
97
97
|
line do
|
98
|
-
plain
|
99
|
-
|
100
|
-
plain
|
101
|
-
|
102
|
-
plain
|
98
|
+
plain %|Expected |
|
99
|
+
actual %|:foo|
|
100
|
+
plain %| not to eq |
|
101
|
+
expected %|:foo|
|
102
|
+
plain %|.|
|
103
103
|
end
|
104
104
|
},
|
105
105
|
)
|
@@ -125,11 +125,11 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
125
125
|
snippet: %|expect("Jennifer").to eq("Marty")|,
|
126
126
|
expectation: proc {
|
127
127
|
line do
|
128
|
-
plain
|
129
|
-
|
130
|
-
plain
|
131
|
-
|
132
|
-
plain
|
128
|
+
plain %|Expected |
|
129
|
+
actual %|"Jennifer"|
|
130
|
+
plain %| to eq |
|
131
|
+
expected %|"Marty"|
|
132
|
+
plain %|.|
|
133
133
|
end
|
134
134
|
},
|
135
135
|
)
|
@@ -153,11 +153,11 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
153
153
|
snippet: %|expect("Jennifer").not_to eq("Jennifer")|,
|
154
154
|
expectation: proc {
|
155
155
|
line do
|
156
|
-
plain
|
157
|
-
|
158
|
-
plain
|
159
|
-
|
160
|
-
plain
|
156
|
+
plain %|Expected |
|
157
|
+
actual %|"Jennifer"|
|
158
|
+
plain %| not to eq |
|
159
|
+
expected %|"Jennifer"|
|
160
|
+
plain %|.|
|
161
161
|
end
|
162
162
|
},
|
163
163
|
)
|
@@ -174,7 +174,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
174
174
|
as_both_colored_and_uncolored do |color_enabled|
|
175
175
|
snippet = <<~RUBY
|
176
176
|
expected = Time.utc(2011, 12, 13, 14, 15, 16)
|
177
|
-
actual
|
177
|
+
actual = Time.utc(2011, 12, 13, 14, 15, 16, 500_000)
|
178
178
|
expect(expected).to eq(actual)
|
179
179
|
RUBY
|
180
180
|
program = make_plain_test_program(
|
@@ -187,26 +187,26 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
187
187
|
snippet: %|expect(expected).to eq(actual)|,
|
188
188
|
expectation: proc {
|
189
189
|
line do
|
190
|
-
plain
|
191
|
-
|
192
|
-
plain
|
193
|
-
|
194
|
-
plain
|
190
|
+
plain %|Expected |
|
191
|
+
actual %|2011-12-13 14:15:16.000 UTC +00:00 (Time)|
|
192
|
+
plain %| to eq |
|
193
|
+
expected %|2011-12-13 14:15:16.500 UTC +00:00 (Time)|
|
194
|
+
plain %|.|
|
195
195
|
end
|
196
196
|
},
|
197
197
|
diff: proc {
|
198
|
-
plain_line
|
199
|
-
plain_line
|
200
|
-
plain_line
|
201
|
-
plain_line
|
202
|
-
plain_line
|
203
|
-
plain_line
|
204
|
-
plain_line
|
205
|
-
|
206
|
-
|
207
|
-
plain_line
|
208
|
-
plain_line
|
209
|
-
plain_line
|
198
|
+
plain_line " #<Time {"
|
199
|
+
plain_line " year: 2011,"
|
200
|
+
plain_line " month: 12,"
|
201
|
+
plain_line " day: 13,"
|
202
|
+
plain_line " hour: 14,"
|
203
|
+
plain_line " min: 15,"
|
204
|
+
plain_line " sec: 16,"
|
205
|
+
expected_line "- nsec: 500000000,"
|
206
|
+
actual_line "+ nsec: 0,"
|
207
|
+
plain_line " zone: \"UTC\","
|
208
|
+
plain_line " gmt_offset: 0"
|
209
|
+
plain_line " }>"
|
210
210
|
},
|
211
211
|
)
|
212
212
|
|
@@ -233,13 +233,13 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
233
233
|
newline_before_expectation: true,
|
234
234
|
expectation: proc {
|
235
235
|
line do
|
236
|
-
plain
|
237
|
-
|
236
|
+
plain %| Expected |
|
237
|
+
actual %|2011-12-13 14:15:16.000 UTC +00:00 (Time)|
|
238
238
|
end
|
239
239
|
|
240
240
|
line do
|
241
|
-
plain
|
242
|
-
|
241
|
+
plain %|not to eq |
|
242
|
+
expected %|2011-12-13 14:15:16.000 UTC +00:00 (Time)|
|
243
243
|
end
|
244
244
|
},
|
245
245
|
)
|
@@ -256,7 +256,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
256
256
|
as_both_colored_and_uncolored do |color_enabled|
|
257
257
|
snippet = <<~RUBY
|
258
258
|
expected = Time.utc(2011, 12, 13, 14, 15, 16)
|
259
|
-
actual
|
259
|
+
actual = Time.utc(2011, 12, 13, 15, 15, 16).in_time_zone("Europe/Stockholm")
|
260
260
|
expect(expected).to eq(actual)
|
261
261
|
RUBY
|
262
262
|
program = make_rspec_rails_test_program(
|
@@ -269,32 +269,32 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
269
269
|
snippet: %|expect(expected).to eq(actual)|,
|
270
270
|
expectation: proc {
|
271
271
|
line do
|
272
|
-
plain
|
273
|
-
|
272
|
+
plain %|Expected |
|
273
|
+
actual %|2011-12-13 14:15:16.000 UTC +00:00 (Time)|
|
274
274
|
end
|
275
275
|
|
276
276
|
line do
|
277
|
-
plain
|
278
|
-
|
277
|
+
plain %| to eq |
|
278
|
+
expected %|2011-12-13 16:15:16.000 CET +01:00 (ActiveSupport::TimeWithZone)|
|
279
279
|
end
|
280
280
|
},
|
281
281
|
diff: proc {
|
282
|
-
plain_line
|
283
|
-
plain_line
|
284
|
-
plain_line
|
285
|
-
plain_line
|
286
|
-
|
287
|
-
|
288
|
-
plain_line
|
289
|
-
plain_line
|
290
|
-
plain_line
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
plain_line
|
282
|
+
plain_line " #<ActiveSupport::TimeWithZone {"
|
283
|
+
plain_line " year: 2011,"
|
284
|
+
plain_line " month: 12,"
|
285
|
+
plain_line " day: 13,"
|
286
|
+
expected_line "- hour: 16,"
|
287
|
+
actual_line "+ hour: 14,"
|
288
|
+
plain_line " min: 15,"
|
289
|
+
plain_line " sec: 16,"
|
290
|
+
plain_line " nsec: 0,"
|
291
|
+
expected_line "- zone: \"CET\","
|
292
|
+
actual_line "+ zone: \"UTC\","
|
293
|
+
expected_line "- gmt_offset: 3600,"
|
294
|
+
actual_line "+ gmt_offset: 0,"
|
295
|
+
expected_line "- utc: 2011-12-13 15:15:16.000 UTC +00:00 (Time)"
|
296
|
+
actual_line "+ utc: 2011-12-13 14:15:16.000 UTC +00:00 (Time)"
|
297
|
+
plain_line " }>"
|
298
298
|
},
|
299
299
|
)
|
300
300
|
|
@@ -310,7 +310,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
310
310
|
as_both_colored_and_uncolored do |color_enabled|
|
311
311
|
snippet = <<~TEST.strip
|
312
312
|
expected = "Something entirely different"
|
313
|
-
actual
|
313
|
+
actual = "This is a line\\nAnd that's another line\\n"
|
314
314
|
expect(actual).to eq(expected)
|
315
315
|
TEST
|
316
316
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
@@ -320,17 +320,17 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
320
320
|
snippet: %|expect(actual).to eq(expected)|,
|
321
321
|
expectation: proc {
|
322
322
|
line do
|
323
|
-
plain
|
324
|
-
|
325
|
-
plain
|
326
|
-
|
327
|
-
plain
|
323
|
+
plain %|Expected |
|
324
|
+
actual %|"This is a line\\nAnd that's another line\\n"|
|
325
|
+
plain %| to eq |
|
326
|
+
expected %|"Something entirely different"|
|
327
|
+
plain %|.|
|
328
328
|
end
|
329
329
|
},
|
330
330
|
diff: proc {
|
331
|
-
|
332
|
-
|
333
|
-
|
331
|
+
expected_line %|- Something entirely different|
|
332
|
+
actual_line %|+ This is a line\\n|
|
333
|
+
actual_line %|+ And that's another line\\n|
|
334
334
|
},
|
335
335
|
)
|
336
336
|
|
@@ -346,7 +346,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
346
346
|
as_both_colored_and_uncolored do |color_enabled|
|
347
347
|
snippet = <<~TEST.strip
|
348
348
|
expected = "This is a line\\nAnd that's another line\\n"
|
349
|
-
actual
|
349
|
+
actual = "Something entirely different"
|
350
350
|
expect(actual).to eq(expected)
|
351
351
|
TEST
|
352
352
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
@@ -356,17 +356,17 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
356
356
|
snippet: %|expect(actual).to eq(expected)|,
|
357
357
|
expectation: proc {
|
358
358
|
line do
|
359
|
-
plain
|
360
|
-
|
361
|
-
plain
|
362
|
-
|
363
|
-
plain
|
359
|
+
plain %|Expected |
|
360
|
+
actual %|"Something entirely different"|
|
361
|
+
plain %| to eq |
|
362
|
+
expected %|"This is a line\\nAnd that's another line\\n"|
|
363
|
+
plain %|.|
|
364
364
|
end
|
365
365
|
},
|
366
366
|
diff: proc {
|
367
|
-
|
368
|
-
|
369
|
-
|
367
|
+
expected_line %|- This is a line\\n|
|
368
|
+
expected_line %|- And that's another line\\n|
|
369
|
+
actual_line %|+ Something entirely different|
|
370
370
|
},
|
371
371
|
)
|
372
372
|
|
@@ -382,7 +382,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
382
382
|
as_both_colored_and_uncolored do |color_enabled|
|
383
383
|
snippet = <<~TEST.strip
|
384
384
|
expected = "This is a line\\nAnd that's a line\\nAnd there's a line too\\n"
|
385
|
-
actual
|
385
|
+
actual = "This is a line\\nSomething completely different\\nAnd there's a line too\\n"
|
386
386
|
expect(actual).to eq(expected)
|
387
387
|
TEST
|
388
388
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
@@ -392,20 +392,20 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
392
392
|
snippet: %|expect(actual).to eq(expected)|,
|
393
393
|
expectation: proc {
|
394
394
|
line do
|
395
|
-
plain
|
396
|
-
|
395
|
+
plain %|Expected |
|
396
|
+
actual %|"This is a line\\nSomething completely different\\nAnd there's a line too\\n"|
|
397
397
|
end
|
398
398
|
|
399
399
|
line do
|
400
|
-
plain
|
401
|
-
|
400
|
+
plain %| to eq |
|
401
|
+
expected %|"This is a line\\nAnd that's a line\\nAnd there's a line too\\n"|
|
402
402
|
end
|
403
403
|
},
|
404
404
|
diff: proc {
|
405
|
-
plain_line
|
406
|
-
|
407
|
-
|
408
|
-
plain_line
|
405
|
+
plain_line %| This is a line\\n|
|
406
|
+
expected_line %|- And that's a line\\n|
|
407
|
+
actual_line %|+ Something completely different\\n|
|
408
|
+
plain_line %| And there's a line too\\n|
|
409
409
|
},
|
410
410
|
)
|
411
411
|
|
@@ -429,13 +429,13 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
429
429
|
newline_before_expectation: true,
|
430
430
|
expectation: proc {
|
431
431
|
line do
|
432
|
-
plain
|
433
|
-
|
432
|
+
plain %| Expected |
|
433
|
+
actual %|"This is a line\\nAnd that's a line\\nAnd there's a line too\\n"|
|
434
434
|
end
|
435
435
|
|
436
436
|
line do
|
437
|
-
plain
|
438
|
-
|
437
|
+
plain %|not to eq |
|
438
|
+
expected %|"This is a line\\nAnd that's a line\\nAnd there's a line too\\n"|
|
439
439
|
end
|
440
440
|
},
|
441
441
|
)
|
@@ -464,7 +464,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
464
464
|
}
|
465
465
|
]
|
466
466
|
]
|
467
|
-
actual
|
467
|
+
actual = [
|
468
468
|
[
|
469
469
|
:h2,
|
470
470
|
[:span, [:text, "Goodbye world"]],
|
@@ -489,45 +489,45 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
489
489
|
snippet: %|expect(actual).to eq(expected)|,
|
490
490
|
expectation: proc {
|
491
491
|
line do
|
492
|
-
plain
|
493
|
-
|
492
|
+
plain %|Expected |
|
493
|
+
actual %|[[:h2, [:span, [:text, "Goodbye world"]], { id: "hero", class: "header", data: { "sticky" => false, :role => "deprecated", :person => #<SuperDiff::Test::Person name: "Doc", age: 60> } }], :br]|
|
494
494
|
end
|
495
495
|
|
496
496
|
line do
|
497
|
-
plain
|
498
|
-
|
497
|
+
plain %| to eq |
|
498
|
+
expected %|[[:h1, [:span, [:text, "Hello world"]], { class: "header", data: { "sticky" => true, :person => #<SuperDiff::Test::Person name: "Marty", age: 60> } }]]|
|
499
499
|
end
|
500
500
|
},
|
501
501
|
diff: proc {
|
502
|
-
plain_line
|
503
|
-
plain_line
|
504
|
-
|
505
|
-
|
506
|
-
plain_line
|
507
|
-
plain_line
|
508
|
-
plain_line
|
509
|
-
plain_line
|
510
|
-
|
511
|
-
|
512
|
-
plain_line
|
513
|
-
plain_line
|
514
|
-
plain_line
|
515
|
-
|
516
|
-
plain_line
|
517
|
-
plain_line
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
plain_line
|
522
|
-
|
523
|
-
|
524
|
-
plain_line
|
525
|
-
plain_line
|
526
|
-
plain_line
|
527
|
-
plain_line
|
528
|
-
plain_line
|
529
|
-
|
530
|
-
plain_line
|
502
|
+
plain_line %| [|
|
503
|
+
plain_line %| [|
|
504
|
+
expected_line %|- :h1,|
|
505
|
+
actual_line %|+ :h2,|
|
506
|
+
plain_line %| [|
|
507
|
+
plain_line %| :span,|
|
508
|
+
plain_line %| [|
|
509
|
+
plain_line %| :text,|
|
510
|
+
expected_line %|- "Hello world"|
|
511
|
+
actual_line %|+ "Goodbye world"|
|
512
|
+
plain_line %| ]|
|
513
|
+
plain_line %| ],|
|
514
|
+
plain_line %| {|
|
515
|
+
actual_line %|+ id: "hero",|
|
516
|
+
plain_line %| class: "header",|
|
517
|
+
plain_line %| data: {|
|
518
|
+
expected_line %|- "sticky" => true,|
|
519
|
+
actual_line %|+ "sticky" => false,|
|
520
|
+
actual_line %|+ role: "deprecated",|
|
521
|
+
plain_line %| person: #<SuperDiff::Test::Person {|
|
522
|
+
expected_line %|- name: "Marty",|
|
523
|
+
actual_line %|+ name: "Doc",|
|
524
|
+
plain_line %| age: 60|
|
525
|
+
plain_line %| }>|
|
526
|
+
plain_line %| }|
|
527
|
+
plain_line %| }|
|
528
|
+
plain_line %| ],|
|
529
|
+
actual_line %|+ :br|
|
530
|
+
plain_line %| ]|
|
531
531
|
},
|
532
532
|
)
|
533
533
|
|
@@ -563,13 +563,13 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
563
563
|
newline_before_expectation: true,
|
564
564
|
expectation: proc {
|
565
565
|
line do
|
566
|
-
plain
|
567
|
-
|
566
|
+
plain %| Expected |
|
567
|
+
actual %|[[:h1, [:span, [:text, "Hello world"]], { class: "header", data: { "sticky" => true, :person => #<SuperDiff::Test::Person name: "Marty", age: 60> } }]]|
|
568
568
|
end
|
569
569
|
|
570
570
|
line do
|
571
|
-
plain
|
572
|
-
|
571
|
+
plain %|not to eq |
|
572
|
+
expected %|[[:h1, [:span, [:text, "Hello world"]], { class: "header", data: { "sticky" => true, :person => #<SuperDiff::Test::Person name: "Marty", age: 60> } }]]|
|
573
573
|
end
|
574
574
|
},
|
575
575
|
)
|
@@ -604,7 +604,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
604
604
|
{ name: "Chevy 4x4" }
|
605
605
|
]
|
606
606
|
}
|
607
|
-
actual
|
607
|
+
actual = {
|
608
608
|
customer: {
|
609
609
|
person: SuperDiff::Test::Person.new(name: "Marty McFly, Jr.", age: 17),
|
610
610
|
shipping_address: {
|
@@ -632,47 +632,47 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
632
632
|
snippet: %|expect(actual).to eq(expected)|,
|
633
633
|
expectation: proc {
|
634
634
|
line do
|
635
|
-
plain
|
636
|
-
|
635
|
+
plain %|Expected |
|
636
|
+
actual %|{ customer: { person: #<SuperDiff::Test::Person name: "Marty McFly, Jr.", age: 17>, 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" }] }|
|
637
637
|
end
|
638
638
|
|
639
639
|
line do
|
640
|
-
plain
|
641
|
-
|
640
|
+
plain %| to eq |
|
641
|
+
expected %|{ customer: { person: #<SuperDiff::Test::Person name: "Marty McFly", age: 17>, 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" }] }|
|
642
642
|
end
|
643
643
|
},
|
644
644
|
diff: proc {
|
645
|
-
plain_line
|
646
|
-
plain_line
|
647
|
-
plain_line
|
648
|
-
|
649
|
-
|
650
|
-
plain_line
|
651
|
-
plain_line
|
652
|
-
plain_line
|
653
|
-
|
654
|
-
|
655
|
-
plain_line
|
656
|
-
plain_line
|
657
|
-
plain_line
|
658
|
-
plain_line
|
659
|
-
plain_line
|
660
|
-
plain_line
|
661
|
-
plain_line
|
662
|
-
plain_line
|
663
|
-
plain_line
|
664
|
-
plain_line
|
665
|
-
plain_line
|
666
|
-
plain_line
|
667
|
-
plain_line
|
668
|
-
plain_line
|
669
|
-
plain_line
|
670
|
-
plain_line
|
671
|
-
|
672
|
-
|
673
|
-
plain_line
|
674
|
-
plain_line
|
675
|
-
plain_line
|
645
|
+
plain_line %| {|
|
646
|
+
plain_line %| customer: {|
|
647
|
+
plain_line %| person: #<SuperDiff::Test::Person {|
|
648
|
+
expected_line %|- name: "Marty McFly",|
|
649
|
+
actual_line %|+ name: "Marty McFly, Jr.",|
|
650
|
+
plain_line %| age: 17|
|
651
|
+
plain_line %| }>,|
|
652
|
+
plain_line %| shipping_address: {|
|
653
|
+
expected_line %|- line_1: "123 Main St.",|
|
654
|
+
actual_line %|+ line_1: "456 Ponderosa Ct.",|
|
655
|
+
plain_line %| city: "Hill Valley",|
|
656
|
+
plain_line %| state: "CA",|
|
657
|
+
plain_line %| zip: "90382"|
|
658
|
+
plain_line %| }|
|
659
|
+
plain_line %| },|
|
660
|
+
plain_line %| items: [|
|
661
|
+
plain_line %| {|
|
662
|
+
plain_line %| name: "Fender Stratocaster",|
|
663
|
+
plain_line %| cost: 100000,|
|
664
|
+
plain_line %| options: [|
|
665
|
+
plain_line %| "red",|
|
666
|
+
plain_line %| "blue",|
|
667
|
+
plain_line %| "green"|
|
668
|
+
plain_line %| ]|
|
669
|
+
plain_line %| },|
|
670
|
+
plain_line %| {|
|
671
|
+
expected_line %|- name: "Chevy 4x4"|
|
672
|
+
actual_line %|+ name: "Mattel Hoverboard"|
|
673
|
+
plain_line %| }|
|
674
|
+
plain_line %| ]|
|
675
|
+
plain_line %| }|
|
676
676
|
},
|
677
677
|
)
|
678
678
|
|
@@ -714,13 +714,13 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
714
714
|
newline_before_expectation: true,
|
715
715
|
expectation: proc {
|
716
716
|
line do
|
717
|
-
plain
|
718
|
-
|
717
|
+
plain %| Expected |
|
718
|
+
actual %|{ customer: { person: #<SuperDiff::Test::Person name: "Marty McFly", age: 17>, 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" }] }|
|
719
719
|
end
|
720
720
|
|
721
721
|
line do
|
722
|
-
plain
|
723
|
-
|
722
|
+
plain %|not to eq |
|
723
|
+
expected %|{ customer: { person: #<SuperDiff::Test::Person name: "Marty McFly", age: 17>, 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" }] }|
|
724
724
|
end
|
725
725
|
},
|
726
726
|
)
|
@@ -740,7 +740,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
740
740
|
name: "Marty",
|
741
741
|
age: 31,
|
742
742
|
)
|
743
|
-
actual
|
743
|
+
actual = SuperDiff::Test::Customer.new(
|
744
744
|
name: "Doc",
|
745
745
|
shipping_address: :some_shipping_address,
|
746
746
|
phone: "1234567890",
|
@@ -755,13 +755,13 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
755
755
|
newline_before_expectation: true,
|
756
756
|
expectation: proc {
|
757
757
|
line do
|
758
|
-
plain
|
759
|
-
|
758
|
+
plain %|Expected |
|
759
|
+
actual %|#<SuperDiff::Test::Customer name: "Doc", shipping_address: :some_shipping_address, phone: "1234567890">|
|
760
760
|
end
|
761
761
|
|
762
762
|
line do
|
763
|
-
plain
|
764
|
-
|
763
|
+
plain %| to eq |
|
764
|
+
expected %|#<SuperDiff::Test::Person name: "Marty", age: 31>|
|
765
765
|
end
|
766
766
|
},
|
767
767
|
)
|
@@ -789,13 +789,13 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
789
789
|
newline_before_expectation: true,
|
790
790
|
expectation: proc {
|
791
791
|
line do
|
792
|
-
plain
|
793
|
-
|
792
|
+
plain %| Expected |
|
793
|
+
actual %|#<SuperDiff::Test::Person name: "Marty", age: 31>|
|
794
794
|
end
|
795
795
|
|
796
796
|
line do
|
797
|
-
plain
|
798
|
-
|
797
|
+
plain %|not to eq |
|
798
|
+
expected %|#<SuperDiff::Test::Person name: "Marty", age: 31>|
|
799
799
|
end
|
800
800
|
},
|
801
801
|
)
|
@@ -815,7 +815,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
815
815
|
name: "camera",
|
816
816
|
quantity: 3,
|
817
817
|
)
|
818
|
-
actual
|
818
|
+
actual = SuperDiff::Test::Player.new(
|
819
819
|
handle: "mcmire",
|
820
820
|
character: "Jon",
|
821
821
|
inventory: ["sword"],
|
@@ -835,13 +835,13 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
835
835
|
if SuperDiff::Test.jruby?
|
836
836
|
else
|
837
837
|
line do
|
838
|
-
plain
|
839
|
-
|
838
|
+
plain %|Expected |
|
839
|
+
actual %|#<SuperDiff::Test::Player @handle="mcmire", @character="Jon", @inventory=["sword"], @shields=11.4, @health=4, @ultimate=true>|
|
840
840
|
end
|
841
841
|
|
842
842
|
line do
|
843
|
-
plain
|
844
|
-
|
843
|
+
plain %| to eq |
|
844
|
+
expected %|#<SuperDiff::Test::Item @name="camera", @quantity=3>|
|
845
845
|
end
|
846
846
|
end
|
847
847
|
},
|
@@ -873,13 +873,13 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
873
873
|
if SuperDiff::Test.jruby?
|
874
874
|
else
|
875
875
|
line do
|
876
|
-
plain
|
877
|
-
|
876
|
+
plain %| Expected |
|
877
|
+
actual %|#<SuperDiff::Test::Item @name="camera", @quantity=3>|
|
878
878
|
end
|
879
879
|
|
880
880
|
line do
|
881
|
-
plain
|
882
|
-
|
881
|
+
plain %|not to eq |
|
882
|
+
expected %|#<SuperDiff::Test::Item @name="camera", @quantity=3>|
|
883
883
|
end
|
884
884
|
end
|
885
885
|
},
|
@@ -898,7 +898,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
898
898
|
as_both_colored_and_uncolored do |color_enabled|
|
899
899
|
snippet = <<~TEST.strip
|
900
900
|
expected = { foo: nil }
|
901
|
-
actual
|
901
|
+
actual = { foo: [] }
|
902
902
|
expect(actual).to eq(expected)
|
903
903
|
TEST
|
904
904
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
@@ -909,18 +909,18 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
909
909
|
newline_before_expectation: true,
|
910
910
|
expectation: proc {
|
911
911
|
line do
|
912
|
-
plain
|
913
|
-
|
914
|
-
plain
|
915
|
-
|
916
|
-
plain
|
912
|
+
plain %|Expected |
|
913
|
+
actual %|{ foo: [] }|
|
914
|
+
plain %| to eq |
|
915
|
+
expected %|{ foo: nil }|
|
916
|
+
plain %|.|
|
917
917
|
end
|
918
918
|
},
|
919
919
|
diff: proc {
|
920
|
-
plain_line
|
921
|
-
|
922
|
-
|
923
|
-
plain_line
|
920
|
+
plain_line %| {|
|
921
|
+
expected_line %|- foo: nil|
|
922
|
+
actual_line %|+ foo: []|
|
923
|
+
plain_line %| }|
|
924
924
|
}
|
925
925
|
)
|
926
926
|
|
@@ -936,7 +936,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
936
936
|
as_both_colored_and_uncolored do |color_enabled|
|
937
937
|
snippet = <<~TEST.strip
|
938
938
|
expected = { foo: nil }
|
939
|
-
actual
|
939
|
+
actual = { foo: {} }
|
940
940
|
expect(actual).to eq(expected)
|
941
941
|
TEST
|
942
942
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
@@ -947,18 +947,18 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
947
947
|
newline_before_expectation: true,
|
948
948
|
expectation: proc {
|
949
949
|
line do
|
950
|
-
plain
|
951
|
-
|
952
|
-
plain
|
953
|
-
|
954
|
-
plain
|
950
|
+
plain %|Expected |
|
951
|
+
actual %|{ foo: {} }|
|
952
|
+
plain %| to eq |
|
953
|
+
expected %|{ foo: nil }|
|
954
|
+
plain %|.|
|
955
955
|
end
|
956
956
|
},
|
957
957
|
diff: proc {
|
958
|
-
plain_line
|
959
|
-
|
960
|
-
|
961
|
-
plain_line
|
958
|
+
plain_line %| {|
|
959
|
+
expected_line %|- foo: nil|
|
960
|
+
actual_line %|+ foo: {}|
|
961
|
+
plain_line %| }|
|
962
962
|
}
|
963
963
|
)
|
964
964
|
|
@@ -974,7 +974,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
974
974
|
as_both_colored_and_uncolored do |color_enabled|
|
975
975
|
snippet = <<~TEST.strip
|
976
976
|
expected = { foo: nil }
|
977
|
-
actual
|
977
|
+
actual = { foo: SuperDiff::Test::EmptyClass.new }
|
978
978
|
expect(actual).to eq(expected)
|
979
979
|
TEST
|
980
980
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
@@ -985,18 +985,18 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
985
985
|
newline_before_expectation: true,
|
986
986
|
expectation: proc {
|
987
987
|
line do
|
988
|
-
plain
|
989
|
-
|
990
|
-
plain
|
991
|
-
|
992
|
-
plain
|
988
|
+
plain %|Expected |
|
989
|
+
actual %|{ foo: #<SuperDiff::Test::EmptyClass> }|
|
990
|
+
plain %| to eq |
|
991
|
+
expected %|{ foo: nil }|
|
992
|
+
plain %|.|
|
993
993
|
end
|
994
994
|
},
|
995
995
|
diff: proc {
|
996
|
-
plain_line
|
997
|
-
|
998
|
-
|
999
|
-
plain_line
|
996
|
+
plain_line %| {|
|
997
|
+
expected_line %|- foo: nil|
|
998
|
+
actual_line %|+ foo: #<SuperDiff::Test::EmptyClass>|
|
999
|
+
plain_line %| }|
|
1000
1000
|
}
|
1001
1001
|
)
|
1002
1002
|
|