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
return"Expected error attributes to match #{@attributes}, but got these mismatches: #{unmatched} and actual values are #{event_data}"
97
+
end
98
+
elsif@error_subscriber.events.empty?
99
+
return'Expected the block to report an error, but none was reported.'
100
+
else
101
+
case@expected_error
102
+
whenClass
103
+
return"Expected error to be an instance of #{@expected_error}, but got #{actual_error.class} with message: '#{actual_error.message}'"
104
+
whenException
105
+
return"Expected error to be #{@expected_error.class} with message '#{@expected_error.message}', but got #{actual_error.class} with message: '#{actual_error.message}'"
106
+
whenRegexp
107
+
return"Expected error message to match #{@expected_error}, but got: '#{actual_error.message}'"
108
+
whenSymbol
109
+
return"Expected error to be #{@expected_error}, but got: #{actual_error}"
110
+
else
111
+
return"Expected specific error, but got #{actual_error.class} with message: '#{actual_error.message}'"
112
+
end
113
+
end
114
+
end
115
+
116
+
deffailure_message_when_negated
117
+
error_count=@error_subscriber.events.count
118
+
ifdefined?(ActiveSupport::Inflector)
119
+
error_word='error'.pluralize(error_count)
120
+
verb=error_count == 1 ? 'has' : 'have'
121
+
else
122
+
error_word=error_count == 1 ? 'error' : 'errors'
123
+
verb=error_count == 1 ? 'has' : 'have'
124
+
end
125
+
"Expected the block not to report any errors, but #{error_count}#{error_word}#{verb} been reported."
0 commit comments