You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
desc += " with message '#{@expected_error.message}'"unless@expected_error.message.empty?
71
-
whenRegexp
72
-
desc="report an error with message matching #{@expected_error}"
73
-
whenSymbol
74
-
desc="report #{@expected_error}"
81
+
if@expected_error_symbol
82
+
desc="report #{@expected_error_symbol}"
83
+
elsif@expected_error_class
84
+
desc="report a #{@expected_error_class} error"
85
+
end
86
+
if@expected_message
87
+
case@expected_message
88
+
whenRegexp
89
+
desc += " with message matching #{@expected_message}"
90
+
whenString
91
+
desc += " with message '#{@expected_message}'"
92
+
end
75
93
end
76
94
desc += " with #{@attributes}"unless@attributes.empty?
77
95
desc
@@ -87,15 +105,17 @@ def failure_message
87
105
elsif@error_subscriber.events.empty?
88
106
return'Expected the block to report an error, but none was reported.'
89
107
else
90
-
case@expected_error
91
-
whenClass
92
-
return"Expected error to be an instance of #{@expected_error}, but got #{actual_error.class} with message: '#{actual_error.message}'"
93
-
whenException
94
-
return"Expected error to be #{@expected_error.class} with message '#{@expected_error.message}', but got #{actual_error.class} with message: '#{actual_error.message}'"
95
-
whenRegexp
96
-
return"Expected error message to match #{@expected_error}, but got: '#{actual_error.message}'"
97
-
whenSymbol
98
-
return"Expected error to be #{@expected_error}, but got: #{actual_error}"
108
+
if@expected_error_symbol
109
+
return"Expected error to be #{@expected_error_symbol}, but got: #{actual_error}"
0 commit comments