mockolo icon indicating copy to clipboard operation
mockolo copied to clipboard

Mock of class with computed properties causes compile error.

Open kaniza opened this issue 10 months ago • 0 comments

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

kaniza avatar Aug 15 '23 05:08 kaniza