File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -213,9 +213,10 @@ def test_numeric_value_out_of_ranges_are_translated_to_specific_exception
213
213
def test_exceptions_from_notifications_are_not_translated
214
214
original_error = StandardError . new ( "This StandardError shouldn't get translated" )
215
215
subscriber = ActiveSupport ::Notifications . subscribe ( "sql.active_record" ) { raise original_error }
216
- actual_error = assert_raises ( StandardError ) do
216
+ wrapped_error = assert_raises ( ActiveSupport :: Notifications :: InstrumentationSubscriberError ) do
217
217
@connection . execute ( "SELECT * FROM posts" )
218
218
end
219
+ actual_error = wrapped_error . exceptions . first
219
220
220
221
assert_equal original_error , actual_error
221
222
Original file line number Diff line number Diff line change @@ -489,11 +489,13 @@ def test_query_cache_does_not_allow_sql_key_mutation
489
489
payload [ :sql ] . downcase!
490
490
end
491
491
492
- assert_raises FrozenError do
492
+ error = assert_raises ActiveSupport :: Notifications :: InstrumentationSubscriberError do
493
493
ActiveRecord ::Base . cache do
494
494
assert_queries ( 1 ) { Task . find ( 1 ) ; Task . find ( 1 ) }
495
495
end
496
496
end
497
+
498
+ assert error . exceptions . first . is_a? ( FrozenError )
497
499
ensure
498
500
ActiveSupport ::Notifications . unsubscribe subscriber
499
501
end
You can’t perform that action at this time.
0 commit comments