File tree Expand file tree Collapse file tree 3 files changed +450
-4
lines changed Expand file tree Collapse file tree 3 files changed +450
-4
lines changed Original file line number Diff line number Diff line change @@ -734,11 +734,9 @@ def actual_for_diff
734
734
735
735
def expected_for_matcher_text
736
736
if @expected_message
737
- "#<#{ @expected_error . name } #{ description_of ( @expected_message ) } >"
738
- elsif @expected_error . is_a? Regexp
739
- "#<Exception #{ description_of ( @expected_error ) } >"
737
+ "#<#{ describe_expected_error } #{ description_of ( @expected_message ) } >"
740
738
else
741
- "#<#{ @expected_error . name } >"
739
+ "#<#{ describe_expected_error } >"
742
740
end
743
741
end
744
742
@@ -757,6 +755,20 @@ def expected_action_for_failure_message
757
755
def matcher_text_builder_class
758
756
SuperDiff ::RSpec ::MatcherTextBuilders ::RaiseError
759
757
end
758
+
759
+ private
760
+
761
+ def describe_expected_error
762
+ if @expected_error . is_a? Class
763
+ @expected_error . name
764
+ elsif @expected_error . is_a? Regexp
765
+ "Exception #{ description_of ( @expected_error ) } "
766
+ elsif @expected_error . respond_to? :description
767
+ @expected_error . description
768
+ else
769
+ SuperDiff . inspect_object ( @expected_error , as_lines : false )
770
+ end
771
+ end
760
772
end
761
773
762
774
def self . matcher_name
You can’t perform that action at this time.
0 commit comments