Commit 5700196
authored
Improve raise_error messages (#218)
This commit makes some minor changes to the `raise_error` matcher to
make the failure messages slightly more friendly and consistent with the
overall philosophy of matchers in this repo.
Here are the current messages in comparison with the new ones:
- In cases where the block raises no error, the wording changes from
"Expected block" to "Expected exception-free block", and "exception-free
block" is highlighted in the actual color. This is to emphasize the
actual behavior vs. the expected behavior and matches other matchers.
- In cases where only an expected error class is provided, the wording
changes so that instead of inspecting the expected error, the failure
message says "a kind of" followed by the class name.
- In cases where a message is provided, the expected class and message
are separated in the failure message.
- In cases where a regexp message is provided, the wording changes from
"with message #{message}" to "with message matching #{message}".
Additionally, the integration tests for `raise_error` have been reviewed
and missing tests have been filled in.1 parent c685536 commit 5700196
File tree
4 files changed
+580
-231
lines changed- lib/super_diff/rspec
- matcher_text_builders
- spec
- integration/rspec
- unit/rspec/matchers
4 files changed
+580
-231
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 8 | + | |
| 9 | + | |
14 | 10 | | |
15 | | - | |
| 11 | + | |
16 | 12 | | |
17 | 13 | | |
18 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
725 | 729 | | |
726 | 730 | | |
727 | 731 | | |
| 732 | + | |
| 733 | + | |
728 | 734 | | |
729 | 735 | | |
730 | 736 | | |
| |||
733 | 739 | | |
734 | 740 | | |
735 | 741 | | |
736 | | - | |
737 | | - | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
738 | 753 | | |
739 | | - | |
| 754 | + | |
740 | 755 | | |
741 | 756 | | |
742 | 757 | | |
| |||
749 | 764 | | |
750 | 765 | | |
751 | 766 | | |
752 | | - | |
| 767 | + | |
753 | 768 | | |
754 | 769 | | |
755 | 770 | | |
| |||
758 | 773 | | |
759 | 774 | | |
760 | 775 | | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
768 | 779 | | |
769 | | - | |
| 780 | + | |
770 | 781 | | |
771 | 782 | | |
772 | 783 | | |
| |||
0 commit comments