Commit a85ecac
authored
Fix failure case for chained matchers (#288)
Fixes #286.
SuperDiff overrides the built-in `RaiseError` matcher to [report that it
is
`diffable?`](https://github.com/splitwise/super_diff/blob/303a5f0d39008ec408d7ab87c5020bdb069558e4/lib/super_diff/rspec/monkey_patches.rb#L836)
in most cases. RSpec accordingly
[assumes](https://github.com/rspec/rspec/blame/a067137e8655e8ee5820a5ebf8ca89054aa9499b/rspec-expectations/lib/rspec/matchers/expecteds_for_multiple_diffs.rb#L37)
that it defines `#expected`. This issue may have existed since
[SuperDiff
0.2.0](0c72106#diff-95eeb68cdb264bd5b96144f59ef69453acfbed67e571cb94d236008a4194217eR414-R416)
and [RSpec
3.2.0](rspec/rspec-expectations@709c8e7#diff-4457c9afedb7030c9af041e6da43bfa3bb2a590b07cb7c64a118486446d3b300R49).
This PR monkey-patches the `#expected` assumption, much in the same way
that we [already
do](https://github.com/splitwise/super_diff/blob/8645b956aa1c43dbde50445b4b99f6fc9504a14a/lib/super_diff/rspec/monkey_patches.rb#L29-L34)
for `#handle_failure`.1 parent 7321553 commit a85ecac
File tree
4 files changed
+79
-2
lines changed- docs/contributors/architecture
- lib/super_diff/rspec
- spec/integration/rspec
4 files changed
+79
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | | - | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
355 | 375 | | |
356 | 376 | | |
357 | 377 | | |
| |||
423 | 443 | | |
424 | 444 | | |
425 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
426 | 466 | | |
427 | 467 | | |
428 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1487 | 1487 | | |
1488 | 1488 | | |
1489 | 1489 | | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
1490 | 1525 | | |
0 commit comments