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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +46 -19
  3. data/lib/super_diff.rb +1 -7
  4. data/lib/super_diff/colorized_document_extensions.rb +4 -4
  5. data/lib/super_diff/configuration.rb +32 -22
  6. data/lib/super_diff/csi.rb +2 -1
  7. data/lib/super_diff/diff_formatters/collection.rb +1 -1
  8. data/lib/super_diff/diff_formatters/multiline_string.rb +4 -4
  9. data/lib/super_diff/equality_matchers/array.rb +2 -2
  10. data/lib/super_diff/equality_matchers/default.rb +2 -2
  11. data/lib/super_diff/equality_matchers/hash.rb +2 -2
  12. data/lib/super_diff/equality_matchers/multiline_string.rb +2 -2
  13. data/lib/super_diff/equality_matchers/primitive.rb +2 -2
  14. data/lib/super_diff/equality_matchers/singleline_string.rb +2 -2
  15. data/lib/super_diff/gem_version.rb +45 -0
  16. data/lib/super_diff/rspec.rb +4 -0
  17. data/lib/super_diff/rspec/matcher_text_builders/base.rb +7 -7
  18. data/lib/super_diff/rspec/matcher_text_builders/be_predicate.rb +6 -6
  19. data/lib/super_diff/rspec/matcher_text_builders/contain_exactly.rb +1 -1
  20. data/lib/super_diff/rspec/matcher_text_builders/have_predicate.rb +4 -4
  21. data/lib/super_diff/rspec/matcher_text_builders/raise_error.rb +1 -1
  22. data/lib/super_diff/rspec/matcher_text_builders/respond_to.rb +5 -5
  23. data/lib/super_diff/rspec/monkey_patches.rb +22 -13
  24. data/lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb +12 -1
  25. data/lib/super_diff/version.rb +1 -1
  26. data/spec/examples.txt +393 -5
  27. data/spec/integration/rspec/be_falsey_matcher_spec.rb +10 -10
  28. data/spec/integration/rspec/be_matcher_spec.rb +100 -100
  29. data/spec/integration/rspec/be_nil_matcher_spec.rb +10 -10
  30. data/spec/integration/rspec/be_predicate_matcher_spec.rb +103 -103
  31. data/spec/integration/rspec/be_truthy_matcher_spec.rb +10 -10
  32. data/spec/integration/rspec/contain_exactly_matcher_spec.rb +107 -107
  33. data/spec/integration/rspec/eq_matcher_spec.rb +230 -230
  34. data/spec/integration/rspec/have_attributes_matcher_spec.rb +129 -129
  35. data/spec/integration/rspec/have_predicate_matcher_spec.rb +65 -65
  36. data/spec/integration/rspec/include_matcher_spec.rb +73 -73
  37. data/spec/integration/rspec/match_array_matcher_spec.rb +119 -119
  38. data/spec/integration/rspec/match_matcher_spec.rb +274 -274
  39. data/spec/integration/rspec/raise_error_matcher_spec.rb +86 -86
  40. data/spec/integration/rspec/respond_to_matcher_spec.rb +240 -240
  41. data/spec/integration/rspec/third_party_matcher_spec.rb +8 -8
  42. data/spec/integration/rspec/unhandled_errors_spec.rb +5 -5
  43. data/spec/spec_helper.rb +22 -13
  44. data/spec/support/integration/helpers.rb +6 -2
  45. data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +1 -1
  46. data/spec/support/integration/test_programs/base.rb +2 -0
  47. data/spec/support/integration/test_programs/rspec_active_record.rb +1 -1
  48. data/spec/support/integration/test_programs/rspec_active_support.rb +17 -0
  49. data/spec/support/integration/test_programs/rspec_rails.rb +1 -1
  50. data/spec/support/shared_examples/active_record.rb +108 -108
  51. data/spec/support/shared_examples/hash_with_indifferent_access.rb +196 -232
  52. data/spec/tmp/integration_spec.rb +15 -0
  53. data/spec/unit/equality_matchers/main_spec.rb +403 -403
  54. data/super_diff.gemspec +1 -1
  55. 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 "Expected "
17
- beta %|nil|
18
- plain " to be "
19
- alpha %|truthy|
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 "Expected "
44
- beta %|true|
45
- plain " not to be "
46
- alpha %|truthy|
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 = ["Marty", "Jennifer", "Doc"]
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 "Expected "
23
- beta %|["Marty", "Jennifer", "Doc"]|
24
- plain " to contain exactly "
25
- alpha %|"Einie"|
26
- plain " and "
27
- alpha %|"Marty"|
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 %| "Marty",|
34
- plain_line %| "Jennifer",|
35
- plain_line %| "Doc",|
36
- alpha_line %|- "Einie"|
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 "Expected "
64
- beta %|["Einie", "Marty"]|
65
- plain " not to contain exactly "
66
- alpha %|"Einie"|
67
- plain " and "
68
- alpha %|"Marty"|
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 " Expected "
112
- beta %|["Marty McFly", "Doc Brown", "Einie", "Lorraine McFly"]|
111
+ plain %| Expected |
112
+ actual %|["Marty McFly", "Doc Brown", "Einie", "Lorraine McFly"]|
113
113
  end
114
114
 
115
115
  line do
116
- plain "to contain exactly "
117
- alpha %|"Doc Brown"|
118
- plain ", "
119
- alpha %|"Marty McFly"|
120
- plain ", "
121
- alpha %|"Biff Tannen"|
122
- plain ", "
123
- alpha %|"George McFly"|
124
- plain " and "
125
- alpha %|"Lorraine McFly"|
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 %| "Marty McFly",|
131
- plain_line %| "Doc Brown",|
132
- plain_line %| "Einie",|
133
- plain_line %| "Lorraine McFly",|
134
- alpha_line %|- "Biff Tannen",|
135
- alpha_line %|- "George McFly"|
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 " Expected "
169
- beta %|["Marty McFly", "Doc Brown", "Einie", "Lorraine McFly"]|
168
+ plain %| Expected |
169
+ actual %|["Marty McFly", "Doc Brown", "Einie", "Lorraine McFly"]|
170
170
  end
171
171
 
172
172
  line do
173
- plain "not to contain exactly "
174
- alpha %|"Marty McFly"|
175
- plain ", "
176
- alpha %|"Doc Brown"|
177
- plain ", "
178
- alpha %|"Einie"|
179
- plain " and "
180
- alpha %|"Lorraine McFly"|
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 " Expected "
222
- beta %|["Marty McFly", "Doc Brown", "Einie", "Lorraine McFly"]|
221
+ plain %| Expected |
222
+ actual %|["Marty McFly", "Doc Brown", "Einie", "Lorraine McFly"]|
223
223
  end
224
224
 
225
225
  line do
226
- plain "to contain exactly "
227
- alpha %|/ Brown$/|
228
- plain ", "
229
- alpha %|"Marty McFly"|
230
- plain ", "
231
- alpha %|"Biff Tannen"|
232
- plain ", "
233
- alpha %|/Georg McFly/|
234
- plain " and "
235
- alpha %|/Lorrain McFly/|
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 %| "Marty McFly",|
241
- plain_line %| "Doc Brown",|
242
- plain_line %| "Einie",|
243
- plain_line %| "Lorraine McFly",|
244
- alpha_line %|- "Biff Tannen",|
245
- alpha_line %|- /Georg McFly/,|
246
- alpha_line %|- /Lorrain McFly/|
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 " Expected "
281
- beta %|[/ Brown$/, "Marty McFly", "Biff Tannen", /Georg McFly/, /Lorrain McFly/]|
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 "not to contain exactly "
286
- alpha %|/ Brown$/|
287
- plain ", "
288
- alpha %|"Marty McFly"|
289
- plain ", "
290
- alpha %|"Biff Tannen"|
291
- plain ", "
292
- alpha %|/Georg McFly/|
293
- plain " and "
294
- alpha %|/Lorrain McFly/|
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 " Expected "
333
- beta %|[{ foo: "bar" }, #<Double (anonymous)>, { blargh: "riddle" }]|
332
+ plain %| Expected |
333
+ actual %|[{ foo: "bar" }, #<Double (anonymous)>, { blargh: "riddle" }]|
334
334
  end
335
335
 
336
336
  line do
337
- plain "to contain exactly "
338
- alpha %|#<a hash including (foo: "bar")>|
339
- plain ", "
340
- alpha %|#<a collection containing exactly ("zing")>|
341
- plain " and "
342
- alpha %|#<an object having attributes (baz: "qux")>|
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 %| foo: "bar"|
349
- plain_line %| },|
350
- plain_line %| #<Double (anonymous)>,|
351
- plain_line %| {|
352
- plain_line %| blargh: "riddle"|
353
- plain_line %| },|
354
- alpha_line %|- #<a collection containing exactly (|
355
- alpha_line %|- "zing"|
356
- alpha_line %|- )>|
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 "Expected "
16
- beta %|1|
17
- plain " to eq "
18
- alpha %|42|
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 "Expected "
41
- beta %|42|
42
- plain " not to eq "
43
- alpha %|42|
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 "Expected "
71
- beta %|:bar|
72
- plain " to eq "
73
- alpha %|:foo|
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 "Expected "
99
- beta %|:foo|
100
- plain " not to eq "
101
- alpha %|:foo|
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 "Expected "
129
- beta %|"Jennifer"|
130
- plain " to eq "
131
- alpha %|"Marty"|
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 "Expected "
157
- beta %|"Jennifer"|
158
- plain " not to eq "
159
- alpha %|"Jennifer"|
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 = Time.utc(2011, 12, 13, 14, 15, 16, 500_000)
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 "Expected "
191
- beta %|2011-12-13 14:15:16.000 UTC +00:00 (Time)|
192
- plain " to eq "
193
- alpha %|2011-12-13 14:15:16.500 UTC +00:00 (Time)|
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 " #<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
- alpha_line "- nsec: 500000000,"
206
- beta_line "+ nsec: 0,"
207
- plain_line " zone: \"UTC\","
208
- plain_line " gmt_offset: 0"
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 " Expected "
237
- beta %|2011-12-13 14:15:16.000 UTC +00:00 (Time)|
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 "not to eq "
242
- alpha %|2011-12-13 14:15:16.000 UTC +00:00 (Time)|
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 = Time.utc(2011, 12, 13, 15, 15, 16).in_time_zone("Europe/Stockholm")
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 "Expected "
273
- beta %|2011-12-13 14:15:16.000 UTC +00:00 (Time)|
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 " to eq "
278
- alpha %|2011-12-13 16:15:16.000 CET +01:00 (ActiveSupport::TimeWithZone)|
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 " #<ActiveSupport::TimeWithZone {"
283
- plain_line " year: 2011,"
284
- plain_line " month: 12,"
285
- plain_line " day: 13,"
286
- alpha_line "- hour: 16,"
287
- beta_line "+ hour: 14,"
288
- plain_line " min: 15,"
289
- plain_line " sec: 16,"
290
- plain_line " nsec: 0,"
291
- alpha_line "- zone: \"CET\","
292
- beta_line "+ zone: \"UTC\","
293
- alpha_line "- gmt_offset: 3600,"
294
- beta_line "+ gmt_offset: 0,"
295
- alpha_line "- utc: 2011-12-13 15:15:16.000 UTC +00:00 (Time)"
296
- beta_line "+ utc: 2011-12-13 14:15:16.000 UTC +00:00 (Time)"
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 = "This is a line\\nAnd that's another line\\n"
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 "Expected "
324
- beta %|"This is a line\\nAnd that's another line\\n"|
325
- plain " to eq "
326
- alpha %|"Something entirely different"|
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
- alpha_line %|- Something entirely different|
332
- beta_line %|+ This is a line\\n|
333
- beta_line %|+ And that's another line\\n|
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 = "Something entirely different"
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 "Expected "
360
- beta %|"Something entirely different"|
361
- plain " to eq "
362
- alpha %|"This is a line\\nAnd that's another line\\n"|
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
- alpha_line %|- This is a line\\n|
368
- alpha_line %|- And that's another line\\n|
369
- beta_line %|+ Something entirely different|
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 = "This is a line\\nSomething completely different\\nAnd there's a line too\\n"
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 "Expected "
396
- beta %|"This is a line\\nSomething completely different\\nAnd there's a line too\\n"|
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 " to eq "
401
- alpha %|"This is a line\\nAnd that's a line\\nAnd there's a line too\\n"|
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 %| This is a line\\n|
406
- alpha_line %|- And that's a line\\n|
407
- beta_line %|+ Something completely different\\n|
408
- plain_line %| And there's a line too\\n|
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 " Expected "
433
- beta %|"This is a line\\nAnd that's a line\\nAnd there's a line too\\n"|
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 "not to eq "
438
- alpha %|"This is a line\\nAnd that's a line\\nAnd there's a line too\\n"|
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 "Expected "
493
- beta %|[[:h2, [:span, [:text, "Goodbye world"]], { id: "hero", class: "header", data: { "sticky" => false, :role => "deprecated", :person => #<SuperDiff::Test::Person name: "Doc", age: 60> } }], :br]|
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 " to eq "
498
- alpha %|[[:h1, [:span, [:text, "Hello world"]], { class: "header", data: { "sticky" => true, :person => #<SuperDiff::Test::Person name: "Marty", age: 60> } }]]|
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
- alpha_line %|- :h1,|
505
- beta_line %|+ :h2,|
506
- plain_line %| [|
507
- plain_line %| :span,|
508
- plain_line %| [|
509
- plain_line %| :text,|
510
- alpha_line %|- "Hello world"|
511
- beta_line %|+ "Goodbye world"|
512
- plain_line %| ]|
513
- plain_line %| ],|
514
- plain_line %| {|
515
- beta_line %|+ id: "hero",|
516
- plain_line %| class: "header",|
517
- plain_line %| data: {|
518
- alpha_line %|- "sticky" => true,|
519
- beta_line %|+ "sticky" => false,|
520
- beta_line %|+ role: "deprecated",|
521
- plain_line %| person: #<SuperDiff::Test::Person {|
522
- alpha_line %|- name: "Marty",|
523
- beta_line %|+ name: "Doc",|
524
- plain_line %| age: 60|
525
- plain_line %| }>|
526
- plain_line %| }|
527
- plain_line %| }|
528
- plain_line %| ],|
529
- beta_line %|+ :br|
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 " Expected "
567
- beta %|[[:h1, [:span, [:text, "Hello world"]], { class: "header", data: { "sticky" => true, :person => #<SuperDiff::Test::Person name: "Marty", age: 60> } }]]|
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 "not to eq "
572
- alpha %|[[:h1, [:span, [:text, "Hello world"]], { class: "header", data: { "sticky" => true, :person => #<SuperDiff::Test::Person name: "Marty", age: 60> } }]]|
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 "Expected "
636
- beta %|{ 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" }] }|
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 " to eq "
641
- alpha %|{ 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" }] }|
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 %| customer: {|
647
- plain_line %| person: #<SuperDiff::Test::Person {|
648
- alpha_line %|- name: "Marty McFly",|
649
- beta_line %|+ name: "Marty McFly, Jr.",|
650
- plain_line %| age: 17|
651
- plain_line %| }>,|
652
- plain_line %| shipping_address: {|
653
- alpha_line %|- line_1: "123 Main St.",|
654
- beta_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
- alpha_line %|- name: "Chevy 4x4"|
672
- beta_line %|+ name: "Mattel Hoverboard"|
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 " Expected "
718
- beta %|{ 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" }] }|
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 "not to eq "
723
- alpha %|{ 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" }] }|
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 = SuperDiff::Test::Customer.new(
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 "Expected "
759
- beta %|#<SuperDiff::Test::Customer name: "Doc", shipping_address: :some_shipping_address, phone: "1234567890">|
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 " to eq "
764
- alpha %|#<SuperDiff::Test::Person name: "Marty", age: 31>|
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 " Expected "
793
- beta %|#<SuperDiff::Test::Person name: "Marty", age: 31>|
792
+ plain %| Expected |
793
+ actual %|#<SuperDiff::Test::Person name: "Marty", age: 31>|
794
794
  end
795
795
 
796
796
  line do
797
- plain "not to eq "
798
- alpha %|#<SuperDiff::Test::Person name: "Marty", age: 31>|
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 = SuperDiff::Test::Player.new(
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 "Expected "
839
- beta %|#<SuperDiff::Test::Player @handle="mcmire", @character="Jon", @inventory=["sword"], @shields=11.4, @health=4, @ultimate=true>|
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 " to eq "
844
- alpha %|#<SuperDiff::Test::Item @name="camera", @quantity=3>|
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 " Expected "
877
- beta %|#<SuperDiff::Test::Item @name="camera", @quantity=3>|
876
+ plain %| Expected |
877
+ actual %|#<SuperDiff::Test::Item @name="camera", @quantity=3>|
878
878
  end
879
879
 
880
880
  line do
881
- plain "not to eq "
882
- alpha %|#<SuperDiff::Test::Item @name="camera", @quantity=3>|
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 = { foo: [] }
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 "Expected "
913
- beta %|{ foo: [] }|
914
- plain " to eq "
915
- alpha %|{ foo: nil }|
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
- alpha_line %|- foo: nil|
922
- beta_line %|+ foo: []|
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 = { foo: {} }
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 "Expected "
951
- beta %|{ foo: {} }|
952
- plain " to eq "
953
- alpha %|{ foo: nil }|
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
- alpha_line %|- foo: nil|
960
- beta_line %|+ foo: {}|
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 = { foo: SuperDiff::Test::EmptyClass.new }
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 "Expected "
989
- beta %|{ foo: #<SuperDiff::Test::EmptyClass> }|
990
- plain " to eq "
991
- alpha %|{ foo: nil }|
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
- alpha_line %|- foo: nil|
998
- beta_line %|+ foo: #<SuperDiff::Test::EmptyClass>|
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