Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to create Stub for framework classes #19

Open
Dinalli opened this issue Dec 18, 2018 · 1 comment
Open

Support to create Stub for framework classes #19

Dinalli opened this issue Dec 18, 2018 · 1 comment

Comments

@Dinalli
Copy link

Dinalli commented Dec 18, 2018

I would like to be able to create Stub / Spy of framework objects.

import Photos

class PHAssetMock: PHAsset {
}

@seanhenry
Copy link
Owner

Hi @Dinalli

Thanks for raising this issue. Creating test doubles from frameworks will require a more sophisticated configuration for SourceKit which unfortunately is quite involved see this previous issue. I'm planning to eventually add support for third party support but it won't be ready any time soon since it is a lot of work.

The easiest work around for now would be to extract PHAsset to a protocol and decouple yourself from the Photos framework which would allow you to stub the protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants