You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Who uses Carthage probably noticed, that there is new framework being built (SwiftyPrototype). The reason for that is that we need two different and distinctive ways to use SwiftyMocky as a prototyping tool or unit testing tool.
We should investigate that area, and we need some requirements for the prototyping part. Some to start:
it needs to run on the device, and not import XCTest
we can rename ...Mock to ...Prototype
From the other requirements, just some ideas:
Make it easier to create 'partial' mocks. For prototyping it makes sense to mock parts that are not done yet, and use concrete implementation whenever possible. I see it something like Given(prototype, .method(willUse: concrete))
Refine variables, so they actually "store" a value.
Include new given type, allowing to contain custom logic. Something like:
Given(prototype,.method(param:.any, willReturn:{ it, param ->Resultin// alter prototype state// inspect params// custom logicreturn result
})
I'm currently using SwiftyPrototype as it is. And it's doing it's job very well :-)
To your first idea: I think it should be possible to set a delegate on the prototype itself, which is used for method(...) if the delegate is set and neither Given(prototype, .method(willReturn: ...)) nor Given(prototype, .method(willProduce: ...)) has been called. I do not think that setting the delegate on a per-method-level is very important. On the contrary: If you only have a per-method-level configuration, it leads to more boilerplate in order to configure the prototype to use the delegate for all or many methods.
Who uses Carthage probably noticed, that there is new framework being built (SwiftyPrototype). The reason for that is that we need two different and distinctive ways to use SwiftyMocky as a prototyping tool or unit testing tool.
We should investigate that area, and we need some requirements for the prototyping part. Some to start:
From the other requirements, just some ideas:
Make it easier to create 'partial' mocks. For prototyping it makes sense to mock parts that are not done yet, and use concrete implementation whenever possible. I see it something like
Given(prototype, .method(willUse: concrete))
Refine variables, so they actually "store" a value.
Include new given type, allowing to contain custom logic. Something like:
I believe it is connected to #79
I would appreciate any feedback to this topic.
The text was updated successfully, but these errors were encountered: