-
Notifications
You must be signed in to change notification settings - Fork 86
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
Make fixture verification a bit strict #280
Conversation
# Conflicts: # Sources/MockoloFramework/Templates/ClosureTemplate.swift # Sources/MockoloFramework/Templates/NominalTemplate.swift # Tests/MockoloTestCase.swift # Tests/TestSendable/FixtureSendable.swift
public private(set) var myStringInBaseSetCallCount = 0 | ||
@Published public var myStringInBase: String = "" { didSet { myStringInBaseSetCallCount += 1 } } | ||
@Published public var myStringInBase: String = "" { didSet { myStringInBaseSetCallCount += 1 } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could find new bug 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much! LGTM from my side.
This fix improves readability of generated mocks and makes it easy to maintain test code!
class MyProtocolMock: MyProtocol { | ||
private var _anotherParam: Any! | ||
private var _anotherParam: Any! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improvement of readability🚀
Currently, in tests, the comparison between the fixture and the actually generated code is done on a word-by-word basis, separated by whitespace.
There might be unnecessary whitespace present in the actually generated code, which is not being detected.
I will make the process slightly more strict and change it to compare on a line-by-line basis.