uber / mockolo

Efficient Mock Generator for Swift
Apache License 2.0
813 stars 86 forks source link

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

Open alexdremov opened 1 year ago

alexdremov commented 1 year ago

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 commented 1 year ago

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

welshm-ideogram commented 7 months ago

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