Created
November 10, 2015 16:11
-
-
Save rob-murray/f456256d75f18efd39aa to your computer and use it in GitHub Desktop.
wisper gem stubber
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StubWorkerService | |
def initialize(method_to_call, *args) | |
@method_to_call = method_to_call | |
@args = args | |
end | |
def subscribe(worker, *_) | |
@worker = worker | |
self | |
end | |
def run | |
@worker.send(@method_to_call, *@args) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment