Skip to content

Commit 090561c

Browse files
committed
Add MockInstrumentationService for tests
1 parent 89721c7 commit 090561c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/test_helper.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,21 @@ def options
4646
end
4747
end
4848
end
49+
50+
class MockInstrumentationService
51+
def initialize
52+
@events = {}
53+
end
54+
55+
def instrument(event, payload)
56+
result = yield(payload)
57+
@events[event] ||= []
58+
@events[event] << [payload, result]
59+
result
60+
end
61+
62+
def subscribe(event)
63+
@events[event] ||= []
64+
@events[event]
65+
end
66+
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy