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

Mock of class with computed properties causes compile error. #245

Open
kaniza opened this issue Aug 15, 2023 · 0 comments
Open

Mock of class with computed properties causes compile error. #245

kaniza opened this issue Aug 15, 2023 · 0 comments

Comments

@kaniza
Copy link

kaniza commented Aug 15, 2023

Generating a mock of a class with the following properties will result in a compile-time error in the callCount section.

var isOpen:Bool {
return true
}

Error:.
Cannot observe read-only property 'isOpen'; it can't change

The relevant code is this part:
override var isOpen: Bool { didSet { isOpenSetCallCount += 1 }

I think callCount is not necessary for read-only Computed Property.

mockolo: 2.0.0 (latest in Homebrew)
macOS 13.5
Swfit: 5.8.1
Xcode: 14.3.1

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

1 participant