Kolos65 / Mockable

A Swift macro driven auto-mocking library.
MIT License
199 stars 14 forks source link

Void method shouldn't need explicit given clause. #33

Closed hainayanda closed 3 months ago

hainayanda commented 3 months ago

So I have this kind of routing protocol:

protocol MyViewRouting {
    func routeToSomeView()
}

I just want to verify that ViewModel is calling routeToSomeView() method once but it will throw a fatal error unless I do something like this which feels unnecessary since it's a non-throwing void method after all:

given(router) .routeToHome().willReturn()

I think in this scenario, this given shouldn't be required at all.

Kolos65 commented 3 months ago

See #28 and #25