File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
instrumentation/active_job
lib/opentelemetry/instrumentation/active_job
test/opentelemetry/instrumentation/active_job Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ def subscribe
64
64
# Removes Event Handler Subscriptions for ActiveJob notifications
65
65
# @note this method is not thread-safe and should not be used in a multi-threaded context
66
66
def unsubscribe
67
- @subscriptions &.each { |subscriber | ActiveSupport ::Notifications . unsubscribe ( subscriber ) }
67
+ @subscriptions &.each { |subscriber | :: ActiveSupport ::Notifications . unsubscribe ( subscriber ) }
68
68
@subscriptions = nil
69
69
end
70
70
end
Original file line number Diff line number Diff line change 50
50
_ ( MixedArgsJob . perform_now ( 'arg1' , 'arg2' , keyword2 : :keyword2 ) ) . must_be_nil # Make sure this runs without raising an error
51
51
end
52
52
end
53
+
54
+ describe 'usage' do
55
+ it 'can unsubscribe' do
56
+ _ ( OpenTelemetry ::Instrumentation ::ActiveJob ::Handlers . instance_variable_get ( :@subscriptions ) ) . wont_be_empty
57
+
58
+ OpenTelemetry ::Instrumentation ::ActiveJob ::Handlers . unsubscribe
59
+
60
+ _ ( OpenTelemetry ::Instrumentation ::ActiveJob ::Handlers . instance_variable_get ( :@subscriptions ) ) . must_be_nil
61
+ end
62
+ end
53
63
end
You can’t perform that action at this time.
0 commit comments