You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use SwiftyMocky for generating Mocks from protocols and we also migrate our project to Swift 6.
Currently we use Sourcery 2.0.2 and it works fine with SwiftyMocky. But after upgrading version of Sourcery to 2.2.6 we have encountered with crash of SwiftyMocky and we decided to make our own version of Mock.swifttemplate for SwiftyMocky where crash was fixed and we added some improvements to it having some adaption to Swift 6.
But we found out that methods allMethods and allVariables from Type from SourceryRuntime generates methods from extensions that don't related with methods of current type. For example:
When we generating with Sourcery 2.0.2 we have such methods in mock class:
@MainActor @objc
open class AlertPresentingViewInputMock: NSObject, AlertPresentingViewInput, Mock {
// ... mock code
open func showAlert(_ alertController: UIAlertController) {
// mock code
}
open func showAlert(withMessage message: String) {
// mock code
}
// ... mock code
}
When we generating with Sourcery 2.2.6 we have such methods in mock class:
@MainActor @objc
open class AlertPresentingViewInputMock: NSObject, AlertPresentingViewInput, Mock {
// ... mock code
open func showAlert(_ alertController: UIAlertController) {
// mock code
}
open func showAlert(withMessage message: String) {
// mock code
}
open func styledForTradingPanel(fillColor: Color, cornerRadius: Double) -> some View {
// mock code
}
// ... mock code
}
Of course, we have found workaround for this in our template file filtering such methods by definedInTypeName?.name property of Method class but we want you to pay attention on this problem as well.
The text was updated successfully, but these errors were encountered:
We use SwiftyMocky for generating Mocks from protocols and we also migrate our project to Swift 6.
Currently we use Sourcery 2.0.2 and it works fine with SwiftyMocky. But after upgrading version of Sourcery to 2.2.6 we have encountered with crash of SwiftyMocky and we decided to make our own version of Mock.swifttemplate for SwiftyMocky where crash was fixed and we added some improvements to it having some adaption to Swift 6.
But we found out that methods
allMethods
andallVariables
fromType
from SourceryRuntime generates methods from extensions that don't related with methods of current type. For example:Protocols to generate in one file:
Some extension of View that doesn't related with AlertPresentingViewInput in other file:
When we generating with Sourcery 2.0.2 we have such methods in mock class:
When we generating with Sourcery 2.2.6 we have such methods in mock class:
Of course, we have found workaround for this in our template file filtering such methods by
definedInTypeName?.name
property ofMethod
class but we want you to pay attention on this problem as well.The text was updated successfully, but these errors were encountered: