Fix finding stubs on types (static methods)

This commit is contained in:
Michael Miller 2021-07-10 22:41:10 -06:00
parent 23fd075d51
commit d9bb8e33fe
No known key found for this signature in database
GPG key ID: FB9F12F7C646A4AD

View file

@ -52,6 +52,10 @@ module Spectator::Mocks
fetch_type(object.class).stubs.find(&.callable?(call))
end
def find_stub(type : T.class, call : MethodCall) forall T
fetch_type(type).stubs.find(&.callable?(call))
end
def record_call(object, call : MethodCall) : Nil
fetch_instance(object).calls << call
fetch_type(object.class).calls << call