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 for async properties? #210

Open
alessioborraccino opened this issue Dec 16, 2022 · 2 comments
Open

support for async properties? #210

alessioborraccino opened this issue Dec 16, 2022 · 2 comments

Comments

@alessioborraccino
Copy link

After swift 5.6 it's possible to declare in protocols async and/or throws properties:

/// @mockable
protocol AsyncProperties {
  var isAvailable: Bool { get async throws }
}

but mockolo still doesnt support this syntax, and generates just a simple Bool property.

class AsyncPropertiesMock: AsyncProperties {
    init() { }
    init(isAvailable: Bool = false) {
        self.isAvailable = isAvailable
    }


    var isAvailableSetCallCount = 0
    var isAvailable: Bool = false { didSet { isAvailableSetCallCount += 1 } }
}

is there any plan to update it so that /// @mockable can successfully also generate an async throws handler for this case?

@sidepelican
Copy link
Collaborator

It should be fixed, but I think it is a less common requirement, so it is not a priority.

@alessioborraccino
Copy link
Author

Not fixed, without a handler i cant test any throwing because the mock doesnt actually throws. Hoping in an update eventually :)

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