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

[BUG] Does not mock protocol requirements from other module #238

Open
alexdremov opened this issue May 21, 2023 · 2 comments
Open

[BUG] Does not mock protocol requirements from other module #238

alexdremov opened this issue May 21, 2023 · 2 comments

Comments

@alexdremov
Copy link

alexdremov commented May 21, 2023

If protocol#1 inherits protocol#2 imported from different module, then protocol#2 requirements are not met:

/// @mockable
protocol Foo: Equatable {
    func foo()
}
class FooMock: Foo {
    init() { }


    private(set) var fooCallCount = 0
    var fooHandler: (() -> ())?
    func foo()  {
        fooCallCount += 1
        if let fooHandler = fooHandler {
            fooHandler()
        }
        
    }
}

Which does not conform to Equatable

@rodericj
Copy link

rodericj commented Jun 2, 2023

You could use the ---header tag to address this, but it can get a bit unwieldy. Have you explored -mocks as well?

@welshm-ideogram
Copy link

I've tried to use -mocks and --mock-filelist and am encountering the same issue

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

3 participants