Skip to content

Commit 1c83baf

Browse files
committed
Remove TrilogyAdapterTest custom notification assertion helpers
1 parent be9aa73 commit 1c83baf

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

activerecord/test/cases/adapters/trilogy/trilogy_adapter_test.rb

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -432,42 +432,4 @@ class TrilogyAdapterTest < ActiveRecord::TrilogyTestCase
432432
ActiveRecord::ConnectionAdapters::TrilogyAdapter.new(prepared_statements: true).connect!
433433
end
434434
end
435-
436-
# Create a temporary subscription to verify notification is sent.
437-
# Optionally verify the notification payload includes expected types.
438-
def assert_notification(notification, expected_payload = {}, &block)
439-
notification_sent = false
440-
441-
subscription = lambda do |_, _, _, _, payload|
442-
notification_sent = true
443-
444-
expected_payload.each do |key, value|
445-
assert(
446-
value === payload[key],
447-
"Expected notification payload[:#{key}] to match #{value.inspect}, but got #{payload[key].inspect}."
448-
)
449-
end
450-
end
451-
452-
ActiveSupport::Notifications.subscribed(subscription, notification) do
453-
block.call if block_given?
454-
end
455-
456-
assert notification_sent, "#{notification} notification was not sent"
457-
end
458-
459-
# Create a temporary subscription to verify notification was not sent.
460-
def assert_no_notification(notification, &block)
461-
notification_sent = false
462-
463-
subscription = lambda do |*args|
464-
notification_sent = true
465-
end
466-
467-
ActiveSupport::Notifications.subscribed(subscription, notification) do
468-
block.call if block_given?
469-
end
470-
471-
assert_not notification_sent, "#{notification} notification was sent"
472-
end
473435
end

0 commit comments

Comments
 (0)