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

Mocks for available(iOS xxx) build error with Stubber variant #264

Closed
JiceDessaint opened this issue Sep 25, 2020 · 1 comment
Closed

Mocks for available(iOS xxx) build error with Stubber variant #264

JiceDessaint opened this issue Sep 25, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@JiceDessaint
Copy link
Contributor

SwiftyMocky 4.0.1 (Cocoapods integration) + SwiftymockyCLI 4.0.1

Got an error when mocking following protocol:

//sourcery: AutoMockable
protocol SomeProtocol {
    @available(iOS 12.0, *)
    func funcA() -> String
}

will produce following code for stubbing method:

        @available(iOS 12.0, *)
	public static func funcA(willReturn: String...) -> MethodStub { ... }
        public static func funcA(willProduce: (Stubber<String>) -> Void) -> MethodStub {
               // Missing @available
        }

willReturn variant is good, but stubber version miss the available annotation, resulting in compilation error 'm_funcA' is only available in iOS 12.0 or newer

image

@g-amichnia
Copy link
Collaborator

Fixed.

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

No branches or pull requests

3 participants