super_diff 0.5.3 → 0.6.1
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 +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 +7 -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 +21 -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 +390 -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
@@ -20,11 +20,11 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
20
20
|
snippet: %|expect { raise StandardError.new('boo') }.to raise_error(RuntimeError)|,
|
21
21
|
expectation: proc {
|
22
22
|
line do
|
23
|
-
plain
|
24
|
-
|
25
|
-
plain
|
26
|
-
|
27
|
-
plain
|
23
|
+
plain %|Expected raised exception |
|
24
|
+
actual %|#<StandardError "boo">|
|
25
|
+
plain %| to match |
|
26
|
+
expected %|#<RuntimeError>|
|
27
|
+
plain %|.|
|
28
28
|
end
|
29
29
|
},
|
30
30
|
)
|
@@ -53,13 +53,13 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
53
53
|
newline_before_expectation: true,
|
54
54
|
expectation: proc {
|
55
55
|
line do
|
56
|
-
plain
|
57
|
-
|
56
|
+
plain %|Expected raised exception |
|
57
|
+
actual %|#<StandardError "this is a super super super long message">|
|
58
58
|
end
|
59
59
|
|
60
60
|
line do
|
61
|
-
plain
|
62
|
-
|
61
|
+
plain %| to match |
|
62
|
+
expected %|#<RuntimeError>|
|
63
63
|
end
|
64
64
|
},
|
65
65
|
)
|
@@ -88,9 +88,9 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
88
88
|
snippet: %|expect { }.to raise_error(RuntimeError)|,
|
89
89
|
expectation: proc {
|
90
90
|
line do
|
91
|
-
plain
|
92
|
-
|
93
|
-
plain
|
91
|
+
plain %|Expected block to raise error |
|
92
|
+
expected %|#<RuntimeError>|
|
93
|
+
plain %|.|
|
94
94
|
end
|
95
95
|
},
|
96
96
|
)
|
@@ -120,11 +120,11 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
120
120
|
snippet: %|expect { raise StandardError.new('boo') }.not_to raise_error(StandardError)|,
|
121
121
|
expectation: proc {
|
122
122
|
line do
|
123
|
-
plain
|
124
|
-
|
125
|
-
plain
|
126
|
-
|
127
|
-
plain
|
123
|
+
plain %|Expected raised exception |
|
124
|
+
actual %|#<StandardError "boo">|
|
125
|
+
plain %| not to match |
|
126
|
+
expected %|#<StandardError>|
|
127
|
+
plain %|.|
|
128
128
|
end
|
129
129
|
},
|
130
130
|
)
|
@@ -153,13 +153,13 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
153
153
|
newline_before_expectation: true,
|
154
154
|
expectation: proc {
|
155
155
|
line do
|
156
|
-
plain
|
157
|
-
|
156
|
+
plain %|Expected raised exception |
|
157
|
+
actual %|#<StandardError "this is a super super long message">|
|
158
158
|
end
|
159
159
|
|
160
160
|
line do
|
161
|
-
plain
|
162
|
-
|
161
|
+
plain %| not to match |
|
162
|
+
expected %|#<StandardError>|
|
163
163
|
end
|
164
164
|
},
|
165
165
|
)
|
@@ -192,11 +192,11 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
192
192
|
snippet: %|expect { raise 'boo' }.to raise_error('hell')|,
|
193
193
|
expectation: proc {
|
194
194
|
line do
|
195
|
-
plain
|
196
|
-
|
197
|
-
plain
|
198
|
-
|
199
|
-
plain
|
195
|
+
plain %|Expected raised exception |
|
196
|
+
actual %|#<RuntimeError "boo">|
|
197
|
+
plain %| to match |
|
198
|
+
expected %|#<Exception "hell">|
|
199
|
+
plain %|.|
|
200
200
|
end
|
201
201
|
},
|
202
202
|
)
|
@@ -228,13 +228,13 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
228
228
|
newline_before_expectation: true,
|
229
229
|
expectation: proc {
|
230
230
|
line do
|
231
|
-
plain
|
232
|
-
|
231
|
+
plain %|Expected raised exception |
|
232
|
+
actual %|#<RuntimeError "some really really really long message">|
|
233
233
|
end
|
234
234
|
|
235
235
|
line do
|
236
|
-
plain
|
237
|
-
|
236
|
+
plain %| to match |
|
237
|
+
expected %|#<Exception "whatever">|
|
238
238
|
end
|
239
239
|
},
|
240
240
|
)
|
@@ -270,19 +270,19 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
270
270
|
snippet: %|expect { raise(actual_message) }.to raise_error(expected_message)|,
|
271
271
|
expectation: proc {
|
272
272
|
line do
|
273
|
-
plain
|
274
|
-
|
273
|
+
plain %|Expected raised exception |
|
274
|
+
actual %|#<RuntimeError "This is fun\\nSo is this">|
|
275
275
|
end
|
276
276
|
|
277
277
|
line do
|
278
|
-
plain
|
279
|
-
|
278
|
+
plain %| to match |
|
279
|
+
expected %|#<Exception "This is fun\\nAnd so is this">|
|
280
280
|
end
|
281
281
|
},
|
282
282
|
diff: proc {
|
283
|
-
plain_line
|
284
|
-
|
285
|
-
|
283
|
+
plain_line %| This is fun\\n|
|
284
|
+
expected_line %|- And so is this|
|
285
|
+
actual_line %|+ So is this|
|
286
286
|
},
|
287
287
|
)
|
288
288
|
|
@@ -312,9 +312,9 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
312
312
|
snippet: %|expect { }.to raise_error('hell')|,
|
313
313
|
expectation: proc {
|
314
314
|
line do
|
315
|
-
plain
|
316
|
-
|
317
|
-
plain
|
315
|
+
plain %|Expected block to raise error |
|
316
|
+
expected %|#<Exception "hell">|
|
317
|
+
plain %|.|
|
318
318
|
end
|
319
319
|
},
|
320
320
|
)
|
@@ -345,13 +345,13 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
345
345
|
newline_before_expectation: true,
|
346
346
|
expectation: proc {
|
347
347
|
line do
|
348
|
-
plain
|
349
|
-
plain
|
348
|
+
plain %| Expected |
|
349
|
+
plain %|block|
|
350
350
|
end
|
351
351
|
|
352
352
|
line do
|
353
|
-
plain
|
354
|
-
|
353
|
+
plain %|to raise error |
|
354
|
+
expected %|#<Exception "this is a super super super super super super long message">|
|
355
355
|
end
|
356
356
|
},
|
357
357
|
)
|
@@ -381,13 +381,13 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
381
381
|
newline_before_expectation: true,
|
382
382
|
expectation: proc {
|
383
383
|
line do
|
384
|
-
plain
|
385
|
-
|
384
|
+
plain %|Expected raised exception |
|
385
|
+
actual %|#<RuntimeError "some really long message">|
|
386
386
|
end
|
387
387
|
|
388
388
|
line do
|
389
|
-
plain
|
390
|
-
|
389
|
+
plain %| not to match |
|
390
|
+
expected %|#<Exception "some really long message">|
|
391
391
|
end
|
392
392
|
},
|
393
393
|
)
|
@@ -419,11 +419,11 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
419
419
|
snippet: %|expect { raise 'boo' }.not_to raise_error('boo')|,
|
420
420
|
expectation: proc {
|
421
421
|
line do
|
422
|
-
plain
|
423
|
-
|
424
|
-
plain
|
425
|
-
|
426
|
-
plain
|
422
|
+
plain %|Expected raised exception |
|
423
|
+
actual %|#<RuntimeError "boo">|
|
424
|
+
plain %| not to match |
|
425
|
+
expected %|#<Exception "boo">|
|
426
|
+
plain %|.|
|
427
427
|
end
|
428
428
|
},
|
429
429
|
)
|
@@ -454,13 +454,13 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
454
454
|
newline_before_expectation: true,
|
455
455
|
expectation: proc {
|
456
456
|
line do
|
457
|
-
plain
|
458
|
-
|
457
|
+
plain %|Expected raised exception |
|
458
|
+
actual %|#<RuntimeError "some really long message">|
|
459
459
|
end
|
460
460
|
|
461
461
|
line do
|
462
|
-
plain
|
463
|
-
|
462
|
+
plain %| not to match |
|
463
|
+
expected %|#<Exception "some really long message">|
|
464
464
|
end
|
465
465
|
},
|
466
466
|
)
|
@@ -493,13 +493,13 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
493
493
|
newline_before_expectation: true,
|
494
494
|
expectation: proc {
|
495
495
|
line do
|
496
|
-
plain
|
497
|
-
|
496
|
+
plain %|Expected raised exception |
|
497
|
+
actual %|#<RuntimeError "This is fun\\nSo is this">|
|
498
498
|
end
|
499
499
|
|
500
500
|
line do
|
501
|
-
plain
|
502
|
-
|
501
|
+
plain %| not to match |
|
502
|
+
expected %|#<Exception "This is fun\\nSo is this">|
|
503
503
|
end
|
504
504
|
},
|
505
505
|
)
|
@@ -534,11 +534,11 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
534
534
|
snippet: %|expect(&block).to raise_error(RuntimeError, 'b')|,
|
535
535
|
expectation: proc {
|
536
536
|
line do
|
537
|
-
plain
|
538
|
-
|
539
|
-
plain
|
540
|
-
|
541
|
-
plain
|
537
|
+
plain %|Expected raised exception |
|
538
|
+
actual %|#<StandardError "a">|
|
539
|
+
plain %| to match |
|
540
|
+
expected %|#<RuntimeError "b">|
|
541
|
+
plain %|.|
|
542
542
|
end
|
543
543
|
},
|
544
544
|
)
|
@@ -568,13 +568,13 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
568
568
|
newline_before_expectation: true,
|
569
569
|
expectation: proc {
|
570
570
|
line do
|
571
|
-
plain
|
572
|
-
|
571
|
+
plain %|Expected raised exception |
|
572
|
+
actual %|#<StandardError "this is a long message">|
|
573
573
|
end
|
574
574
|
|
575
575
|
line do
|
576
|
-
plain
|
577
|
-
|
576
|
+
plain %| to match |
|
577
|
+
expected %|#<RuntimeError "this is another long message">|
|
578
578
|
end
|
579
579
|
},
|
580
580
|
)
|
@@ -604,9 +604,9 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
604
604
|
snippet: %|expect { }.to raise_error(RuntimeError, 'b')|,
|
605
605
|
expectation: proc {
|
606
606
|
line do
|
607
|
-
plain
|
608
|
-
|
609
|
-
plain
|
607
|
+
plain %|Expected block to raise error |
|
608
|
+
expected %|#<RuntimeError "b">|
|
609
|
+
plain %|.|
|
610
610
|
end
|
611
611
|
},
|
612
612
|
)
|
@@ -635,13 +635,13 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
635
635
|
newline_before_expectation: true,
|
636
636
|
expectation: proc {
|
637
637
|
line do
|
638
|
-
plain
|
639
|
-
plain
|
638
|
+
plain %| Expected |
|
639
|
+
plain %|block|
|
640
640
|
end
|
641
641
|
|
642
642
|
line do
|
643
|
-
plain
|
644
|
-
|
643
|
+
plain %|to raise error |
|
644
|
+
expected %|#<RuntimeError "this is a super super super super super super long message">|
|
645
645
|
end
|
646
646
|
},
|
647
647
|
)
|
@@ -673,11 +673,11 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
673
673
|
snippet: %|expect(&block).not_to raise_error(StandardError, 'a')|,
|
674
674
|
expectation: proc {
|
675
675
|
line do
|
676
|
-
plain
|
677
|
-
|
678
|
-
plain
|
679
|
-
|
680
|
-
plain
|
676
|
+
plain %|Expected raised exception |
|
677
|
+
actual %|#<StandardError "a">|
|
678
|
+
plain %| not to match |
|
679
|
+
expected %|#<StandardError "a">|
|
680
|
+
plain %|.|
|
681
681
|
end
|
682
682
|
},
|
683
683
|
)
|
@@ -707,13 +707,13 @@ RSpec.describe "Integration with RSpec's #raise_error matcher", type: :integrati
|
|
707
707
|
newline_before_expectation: true,
|
708
708
|
expectation: proc {
|
709
709
|
line do
|
710
|
-
plain
|
711
|
-
|
710
|
+
plain %|Expected raised exception |
|
711
|
+
actual %|#<StandardError "this is a long message">|
|
712
712
|
end
|
713
713
|
|
714
714
|
line do
|
715
|
-
plain
|
716
|
-
|
715
|
+
plain %| not to match |
|
716
|
+
expected %|#<StandardError "this is a long message">|
|
717
717
|
end
|
718
718
|
},
|
719
719
|
)
|
@@ -17,11 +17,11 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
17
17
|
snippet: snippet,
|
18
18
|
expectation: proc {
|
19
19
|
line do
|
20
|
-
plain
|
21
|
-
|
22
|
-
plain
|
23
|
-
|
24
|
-
plain
|
20
|
+
plain %|Expected |
|
21
|
+
actual %|#<Double (anonymous)>|
|
22
|
+
plain %| to respond to |
|
23
|
+
expected %|:foo|
|
24
|
+
plain %|.|
|
25
25
|
end
|
26
26
|
},
|
27
27
|
)
|
@@ -45,11 +45,11 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
45
45
|
snippet: snippet,
|
46
46
|
expectation: proc {
|
47
47
|
line do
|
48
|
-
plain
|
49
|
-
|
50
|
-
plain
|
51
|
-
|
52
|
-
plain
|
48
|
+
plain %|Expected |
|
49
|
+
actual %|#<Double (anonymous)>|
|
50
|
+
plain %| not to respond to |
|
51
|
+
expected %|:inspect|
|
52
|
+
plain %|.|
|
53
53
|
end
|
54
54
|
},
|
55
55
|
)
|
@@ -78,25 +78,25 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
78
78
|
newline_before_expectation: true,
|
79
79
|
expectation: proc {
|
80
80
|
line do
|
81
|
-
plain
|
82
|
-
|
81
|
+
plain %| Expected |
|
82
|
+
actual %|#<Double :something_really_long>|
|
83
83
|
end
|
84
84
|
|
85
85
|
line do
|
86
|
-
plain
|
87
|
-
|
88
|
-
plain
|
89
|
-
|
90
|
-
plain
|
91
|
-
|
92
|
-
plain
|
93
|
-
|
94
|
-
plain
|
95
|
-
|
96
|
-
plain
|
97
|
-
|
98
|
-
plain
|
99
|
-
|
86
|
+
plain %|to respond to |
|
87
|
+
expected %|:foo|
|
88
|
+
plain %|, |
|
89
|
+
expected %|:bar|
|
90
|
+
plain %|, |
|
91
|
+
expected %|:baz|
|
92
|
+
plain %|, |
|
93
|
+
expected %|:qux|
|
94
|
+
plain %|, |
|
95
|
+
expected %|:fizz|
|
96
|
+
plain %|, |
|
97
|
+
expected %|:buzz|
|
98
|
+
plain %| and |
|
99
|
+
expected %|:zing|
|
100
100
|
end
|
101
101
|
},
|
102
102
|
)
|
@@ -128,15 +128,15 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
128
128
|
newline_before_expectation: true,
|
129
129
|
expectation: proc {
|
130
130
|
line do
|
131
|
-
plain
|
132
|
-
|
131
|
+
plain %| Expected |
|
132
|
+
actual %|#<B>|
|
133
133
|
end
|
134
134
|
|
135
135
|
line do
|
136
|
-
plain
|
137
|
-
|
138
|
-
plain
|
139
|
-
|
136
|
+
plain %|not to respond to |
|
137
|
+
expected %|:some_really_long_method_and_stuff|
|
138
|
+
plain %| and |
|
139
|
+
expected %|:another_method_or_whatever|
|
140
140
|
end
|
141
141
|
},
|
142
142
|
)
|
@@ -167,13 +167,13 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
167
167
|
snippet: %|expect(double).to respond_to(:foo).with(3).arguments|,
|
168
168
|
expectation: proc {
|
169
169
|
line do
|
170
|
-
plain
|
171
|
-
|
172
|
-
plain
|
173
|
-
|
174
|
-
plain
|
175
|
-
|
176
|
-
plain
|
170
|
+
plain %|Expected |
|
171
|
+
actual %|#<Double (anonymous)>|
|
172
|
+
plain %| to respond to |
|
173
|
+
expected %|:foo|
|
174
|
+
plain %| with |
|
175
|
+
expected %|3|
|
176
|
+
plain %| arguments.|
|
177
177
|
end
|
178
178
|
},
|
179
179
|
)
|
@@ -203,13 +203,13 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
203
203
|
snippet: %|expect(B.new).not_to respond_to(:foo).with(3).arguments|,
|
204
204
|
expectation: proc {
|
205
205
|
line do
|
206
|
-
plain
|
207
|
-
|
208
|
-
plain
|
209
|
-
|
210
|
-
plain
|
211
|
-
|
212
|
-
plain
|
206
|
+
plain %|Expected |
|
207
|
+
actual %|#<B>|
|
208
|
+
plain %| not to respond to |
|
209
|
+
expected %|:foo|
|
210
|
+
plain %| with |
|
211
|
+
expected %|3|
|
212
|
+
plain %| arguments.|
|
213
213
|
end
|
214
214
|
},
|
215
215
|
)
|
@@ -239,24 +239,24 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
239
239
|
newline_before_expectation: true,
|
240
240
|
expectation: proc {
|
241
241
|
line do
|
242
|
-
plain
|
243
|
-
|
242
|
+
plain %| Expected |
|
243
|
+
actual %|#<Double :something_really_long>|
|
244
244
|
end
|
245
245
|
|
246
246
|
line do
|
247
|
-
plain
|
248
|
-
|
249
|
-
plain
|
250
|
-
|
251
|
-
plain
|
252
|
-
|
253
|
-
plain
|
254
|
-
|
255
|
-
plain
|
256
|
-
|
257
|
-
plain
|
258
|
-
|
259
|
-
plain
|
247
|
+
plain %|to respond to |
|
248
|
+
expected %|:foo|
|
249
|
+
plain %|, |
|
250
|
+
expected %|:bar|
|
251
|
+
plain %|, |
|
252
|
+
expected %|:baz|
|
253
|
+
plain %|, |
|
254
|
+
expected %|:fizz|
|
255
|
+
plain %| and |
|
256
|
+
expected %|:buzz|
|
257
|
+
plain %| with |
|
258
|
+
expected %|3|
|
259
|
+
plain %| arguments|
|
260
260
|
end
|
261
261
|
},
|
262
262
|
)
|
@@ -288,18 +288,18 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
288
288
|
newline_before_expectation: true,
|
289
289
|
expectation: proc {
|
290
290
|
line do
|
291
|
-
plain
|
292
|
-
|
291
|
+
plain %| Expected |
|
292
|
+
actual %|#<B>|
|
293
293
|
end
|
294
294
|
|
295
295
|
line do
|
296
|
-
plain
|
297
|
-
|
298
|
-
plain
|
299
|
-
|
300
|
-
plain
|
301
|
-
|
302
|
-
plain
|
296
|
+
plain %|not to respond to |
|
297
|
+
expected %|:some_really_long_method_and_stuff|
|
298
|
+
plain %| and |
|
299
|
+
expected %|:another_method_or_whatever|
|
300
|
+
plain %| with |
|
301
|
+
expected %|3|
|
302
|
+
plain %| arguments|
|
303
303
|
end
|
304
304
|
},
|
305
305
|
)
|
@@ -330,13 +330,13 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
330
330
|
snippet: %|expect(double).to respond_to(:foo).with_keywords(:bar)|,
|
331
331
|
expectation: proc {
|
332
332
|
line do
|
333
|
-
plain
|
334
|
-
|
335
|
-
plain
|
336
|
-
|
337
|
-
plain
|
338
|
-
|
339
|
-
plain
|
333
|
+
plain %|Expected |
|
334
|
+
actual %|#<Double (anonymous)>|
|
335
|
+
plain %| to respond to |
|
336
|
+
expected %|:foo|
|
337
|
+
plain %| with keyword |
|
338
|
+
expected %|:bar|
|
339
|
+
plain %|.|
|
340
340
|
end
|
341
341
|
},
|
342
342
|
)
|
@@ -366,13 +366,13 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
366
366
|
snippet: %|expect(B.new).not_to respond_to(:foo).with_keywords(:bar)|,
|
367
367
|
expectation: proc {
|
368
368
|
line do
|
369
|
-
plain
|
370
|
-
|
371
|
-
plain
|
372
|
-
|
373
|
-
plain
|
374
|
-
|
375
|
-
plain
|
369
|
+
plain %|Expected |
|
370
|
+
actual %|#<B>|
|
371
|
+
plain %| not to respond to |
|
372
|
+
expected %|:foo|
|
373
|
+
plain %| with keyword |
|
374
|
+
expected %|:bar|
|
375
|
+
plain %|.|
|
376
376
|
end
|
377
377
|
},
|
378
378
|
)
|
@@ -402,25 +402,25 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
402
402
|
newline_before_expectation: true,
|
403
403
|
expectation: proc {
|
404
404
|
line do
|
405
|
-
plain
|
406
|
-
|
405
|
+
plain %| Expected |
|
406
|
+
actual %|#<Double :something_really_long>|
|
407
407
|
end
|
408
408
|
|
409
409
|
line do
|
410
|
-
plain
|
411
|
-
|
412
|
-
plain
|
413
|
-
|
414
|
-
plain
|
415
|
-
|
416
|
-
plain
|
417
|
-
|
418
|
-
plain
|
419
|
-
|
420
|
-
plain
|
421
|
-
|
422
|
-
plain
|
423
|
-
|
410
|
+
plain %|to respond to |
|
411
|
+
expected %|:foo|
|
412
|
+
plain %|, |
|
413
|
+
expected %|:bar|
|
414
|
+
plain %|, |
|
415
|
+
expected %|:baz|
|
416
|
+
plain %|, |
|
417
|
+
expected %|:fizz|
|
418
|
+
plain %| and |
|
419
|
+
expected %|:buzz|
|
420
|
+
plain %| with keywords |
|
421
|
+
expected %|:qux|
|
422
|
+
plain %| and |
|
423
|
+
expected %|:blargh|
|
424
424
|
end
|
425
425
|
},
|
426
426
|
)
|
@@ -452,19 +452,19 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
452
452
|
newline_before_expectation: true,
|
453
453
|
expectation: proc {
|
454
454
|
line do
|
455
|
-
plain
|
456
|
-
|
455
|
+
plain %| Expected |
|
456
|
+
actual %|#<B>|
|
457
457
|
end
|
458
458
|
|
459
459
|
line do
|
460
|
-
plain
|
461
|
-
|
462
|
-
plain
|
463
|
-
|
464
|
-
plain
|
465
|
-
|
466
|
-
plain
|
467
|
-
|
460
|
+
plain %|not to respond to |
|
461
|
+
expected %|:some_really_long_method_and_stuff|
|
462
|
+
plain %| and |
|
463
|
+
expected %|:another_method_or_whatever|
|
464
|
+
plain %| with keywords |
|
465
|
+
expected %|:foo|
|
466
|
+
plain %| and |
|
467
|
+
expected %|:bar|
|
468
468
|
end
|
469
469
|
},
|
470
470
|
)
|
@@ -495,13 +495,13 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
495
495
|
snippet: %|expect(double).to respond_to(:foo).with_any_keywords|,
|
496
496
|
expectation: proc {
|
497
497
|
line do
|
498
|
-
plain
|
499
|
-
|
500
|
-
plain
|
501
|
-
|
502
|
-
plain
|
503
|
-
|
504
|
-
plain
|
498
|
+
plain %|Expected |
|
499
|
+
actual %|#<Double (anonymous)>|
|
500
|
+
plain %| to respond to |
|
501
|
+
expected %|:foo|
|
502
|
+
plain %| with |
|
503
|
+
expected %|any|
|
504
|
+
plain %| keywords.|
|
505
505
|
end
|
506
506
|
},
|
507
507
|
)
|
@@ -531,13 +531,13 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
531
531
|
snippet: %|expect(B.new).not_to respond_to(:foo).with_any_keywords|,
|
532
532
|
expectation: proc {
|
533
533
|
line do
|
534
|
-
plain
|
535
|
-
|
536
|
-
plain
|
537
|
-
|
538
|
-
plain
|
539
|
-
|
540
|
-
plain
|
534
|
+
plain %|Expected |
|
535
|
+
actual %|#<B>|
|
536
|
+
plain %| not to respond to |
|
537
|
+
expected %|:foo|
|
538
|
+
plain %| with |
|
539
|
+
expected %|any|
|
540
|
+
plain %| keywords.|
|
541
541
|
end
|
542
542
|
},
|
543
543
|
)
|
@@ -567,26 +567,26 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
567
567
|
newline_before_expectation: true,
|
568
568
|
expectation: proc {
|
569
569
|
line do
|
570
|
-
plain
|
571
|
-
|
570
|
+
plain %| Expected |
|
571
|
+
actual %|#<Double :something_really_long>|
|
572
572
|
end
|
573
573
|
|
574
574
|
line do
|
575
|
-
plain
|
576
|
-
|
577
|
-
plain
|
578
|
-
|
579
|
-
plain
|
580
|
-
|
581
|
-
plain
|
582
|
-
|
583
|
-
plain
|
584
|
-
|
585
|
-
plain
|
586
|
-
|
587
|
-
plain
|
588
|
-
|
589
|
-
plain
|
575
|
+
plain %|to respond to |
|
576
|
+
expected %|:foo|
|
577
|
+
plain %|, |
|
578
|
+
expected %|:bar|
|
579
|
+
plain %|, |
|
580
|
+
expected %|:baz|
|
581
|
+
plain %|, |
|
582
|
+
expected %|:qux|
|
583
|
+
plain %|, |
|
584
|
+
expected %|:fizz|
|
585
|
+
plain %| and |
|
586
|
+
expected %|:buzz|
|
587
|
+
plain %| with |
|
588
|
+
expected %|any|
|
589
|
+
plain %| keywords |
|
590
590
|
end
|
591
591
|
},
|
592
592
|
)
|
@@ -618,18 +618,18 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
618
618
|
newline_before_expectation: true,
|
619
619
|
expectation: proc {
|
620
620
|
line do
|
621
|
-
plain
|
622
|
-
|
621
|
+
plain %| Expected |
|
622
|
+
actual %|#<B>|
|
623
623
|
end
|
624
624
|
|
625
625
|
line do
|
626
|
-
plain
|
627
|
-
|
628
|
-
plain
|
629
|
-
|
630
|
-
plain
|
631
|
-
|
632
|
-
plain
|
626
|
+
plain %|not to respond to |
|
627
|
+
expected %|:some_really_long_method_and_stuff|
|
628
|
+
plain %| and |
|
629
|
+
expected %|:another_method_or_whatever|
|
630
|
+
plain %| with |
|
631
|
+
expected %|any|
|
632
|
+
plain %| keywords |
|
633
633
|
end
|
634
634
|
},
|
635
635
|
)
|
@@ -660,13 +660,13 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
660
660
|
snippet: %|expect(double).to respond_to(:foo).with_unlimited_arguments|,
|
661
661
|
expectation: proc {
|
662
662
|
line do
|
663
|
-
plain
|
664
|
-
|
665
|
-
plain
|
666
|
-
|
667
|
-
plain
|
668
|
-
|
669
|
-
plain
|
663
|
+
plain %|Expected |
|
664
|
+
actual %|#<Double (anonymous)>|
|
665
|
+
plain %| to respond to |
|
666
|
+
expected %|:foo|
|
667
|
+
plain %| with |
|
668
|
+
expected %|unlimited|
|
669
|
+
plain %| arguments.|
|
670
670
|
end
|
671
671
|
},
|
672
672
|
)
|
@@ -696,13 +696,13 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
696
696
|
snippet: %|expect(B.new).not_to respond_to(:foo).with_unlimited_arguments|,
|
697
697
|
expectation: proc {
|
698
698
|
line do
|
699
|
-
plain
|
700
|
-
|
701
|
-
plain
|
702
|
-
|
703
|
-
plain
|
704
|
-
|
705
|
-
plain
|
699
|
+
plain %|Expected |
|
700
|
+
actual %|#<B>|
|
701
|
+
plain %| not to respond to |
|
702
|
+
expected %|:foo|
|
703
|
+
plain %| with |
|
704
|
+
expected %|unlimited|
|
705
|
+
plain %| arguments.|
|
706
706
|
end
|
707
707
|
},
|
708
708
|
)
|
@@ -732,20 +732,20 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
732
732
|
newline_before_expectation: true,
|
733
733
|
expectation: proc {
|
734
734
|
line do
|
735
|
-
plain
|
736
|
-
|
735
|
+
plain %| Expected |
|
736
|
+
actual %|#<Double :something_really_long>|
|
737
737
|
end
|
738
738
|
|
739
739
|
line do
|
740
|
-
plain
|
741
|
-
|
742
|
-
plain
|
743
|
-
|
744
|
-
plain
|
745
|
-
|
746
|
-
plain
|
747
|
-
|
748
|
-
plain
|
740
|
+
plain %|to respond to |
|
741
|
+
expected %|:foo|
|
742
|
+
plain %|, |
|
743
|
+
expected %|:bar|
|
744
|
+
plain %| and |
|
745
|
+
expected %|:baz|
|
746
|
+
plain %| with |
|
747
|
+
expected %|unlimited|
|
748
|
+
plain %| arguments|
|
749
749
|
end
|
750
750
|
},
|
751
751
|
)
|
@@ -777,18 +777,18 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
777
777
|
newline_before_expectation: true,
|
778
778
|
expectation: proc {
|
779
779
|
line do
|
780
|
-
plain
|
781
|
-
|
780
|
+
plain %| Expected |
|
781
|
+
actual %|#<B>|
|
782
782
|
end
|
783
783
|
|
784
784
|
line do
|
785
|
-
plain
|
786
|
-
|
787
|
-
plain
|
788
|
-
|
789
|
-
plain
|
790
|
-
|
791
|
-
plain
|
785
|
+
plain %|not to respond to |
|
786
|
+
expected %|:some_really_long_method_and_stuff|
|
787
|
+
plain %| and |
|
788
|
+
expected %|:another_method_or_whatever|
|
789
|
+
plain %| with |
|
790
|
+
expected %|unlimited|
|
791
|
+
plain %| arguments|
|
792
792
|
end
|
793
793
|
},
|
794
794
|
)
|
@@ -819,22 +819,22 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
819
819
|
newline_before_expectation: true,
|
820
820
|
expectation: proc {
|
821
821
|
line do
|
822
|
-
plain
|
823
|
-
|
822
|
+
plain %| Expected |
|
823
|
+
actual %|#<Double :something_really_long>|
|
824
824
|
end
|
825
825
|
|
826
826
|
line do
|
827
|
-
plain
|
828
|
-
|
829
|
-
plain
|
830
|
-
|
831
|
-
plain
|
832
|
-
|
833
|
-
plain
|
834
|
-
|
835
|
-
plain
|
836
|
-
|
837
|
-
plain
|
827
|
+
plain %|to respond to |
|
828
|
+
expected %|:foo|
|
829
|
+
plain %|, |
|
830
|
+
expected %|:bar|
|
831
|
+
plain %| and |
|
832
|
+
expected %|:baz|
|
833
|
+
plain %| with |
|
834
|
+
expected %|any|
|
835
|
+
plain %| keywords and |
|
836
|
+
expected %|unlimited|
|
837
|
+
plain %| arguments|
|
838
838
|
end
|
839
839
|
},
|
840
840
|
)
|
@@ -867,22 +867,22 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
867
867
|
newline_before_expectation: true,
|
868
868
|
expectation: proc {
|
869
869
|
line do
|
870
|
-
plain
|
871
|
-
|
870
|
+
plain %| Expected |
|
871
|
+
actual %|#<B>|
|
872
872
|
end
|
873
873
|
|
874
874
|
line do
|
875
|
-
plain
|
876
|
-
|
877
|
-
plain
|
878
|
-
|
879
|
-
plain
|
880
|
-
|
881
|
-
plain
|
882
|
-
|
883
|
-
plain
|
884
|
-
|
885
|
-
plain
|
875
|
+
plain %|not to respond to |
|
876
|
+
expected %|:foo|
|
877
|
+
plain %|, |
|
878
|
+
expected %|:bar|
|
879
|
+
plain %| and |
|
880
|
+
expected %|:baz|
|
881
|
+
plain %| with |
|
882
|
+
expected %|any|
|
883
|
+
plain %| keywords and |
|
884
|
+
expected %|unlimited|
|
885
|
+
plain %| arguments|
|
886
886
|
end
|
887
887
|
},
|
888
888
|
)
|
@@ -912,24 +912,24 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
912
912
|
newline_before_expectation: true,
|
913
913
|
expectation: proc {
|
914
914
|
line do
|
915
|
-
plain
|
916
|
-
|
915
|
+
plain %| Expected |
|
916
|
+
actual %|#<Double :something_really_long>|
|
917
917
|
end
|
918
918
|
|
919
919
|
line do
|
920
|
-
plain
|
921
|
-
|
922
|
-
plain
|
923
|
-
|
924
|
-
plain
|
925
|
-
|
926
|
-
plain
|
927
|
-
|
928
|
-
plain
|
929
|
-
|
930
|
-
plain
|
931
|
-
|
932
|
-
plain
|
920
|
+
plain %|to respond to |
|
921
|
+
expected %|:foo|
|
922
|
+
plain %|, |
|
923
|
+
expected %|:bar|
|
924
|
+
plain %| and |
|
925
|
+
expected %|:baz|
|
926
|
+
plain %| with keywords |
|
927
|
+
expected %|:qux|
|
928
|
+
plain %| and |
|
929
|
+
expected %|:blargh|
|
930
|
+
plain %| and |
|
931
|
+
expected %|unlimited|
|
932
|
+
plain %| arguments|
|
933
933
|
end
|
934
934
|
},
|
935
935
|
)
|
@@ -962,24 +962,24 @@ RSpec.describe "Integration with RSpec's #respond_to matcher", type: :integratio
|
|
962
962
|
newline_before_expectation: true,
|
963
963
|
expectation: proc {
|
964
964
|
line do
|
965
|
-
plain
|
966
|
-
|
965
|
+
plain %| Expected |
|
966
|
+
actual %|#<B>|
|
967
967
|
end
|
968
968
|
|
969
969
|
line do
|
970
|
-
plain
|
971
|
-
|
972
|
-
plain
|
973
|
-
|
974
|
-
plain
|
975
|
-
|
976
|
-
plain
|
977
|
-
|
978
|
-
plain
|
979
|
-
|
980
|
-
plain
|
981
|
-
|
982
|
-
plain
|
970
|
+
plain %|not to respond to |
|
971
|
+
expected %|:foo|
|
972
|
+
plain %|, |
|
973
|
+
expected %|:bar|
|
974
|
+
plain %| and |
|
975
|
+
expected %|:baz|
|
976
|
+
plain %| with keywords |
|
977
|
+
expected %|:qux|
|
978
|
+
plain %| and |
|
979
|
+
expected %|:blargh|
|
980
|
+
plain %| and |
|
981
|
+
expected %|unlimited|
|
982
|
+
plain %| arguments|
|
983
983
|
end
|
984
984
|
},
|
985
985
|
)
|