From 488a741dfc5a004376aeafa0db4a5321305730af Mon Sep 17 00:00:00 2001 From: Dariusz Rybicki <dariusz@elixxir.io> Date: Mon, 18 Jul 2022 13:55:48 +0100 Subject: [PATCH] Use dynamic overlay for unimplemented stuff --- Sources/CollectionView/CellFactory.swift | 7 ++++--- Sources/CollectionView/ViewConfigurator.swift | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Sources/CollectionView/CellFactory.swift b/Sources/CollectionView/CellFactory.swift index a828584d..bc7bc9be 100644 --- a/Sources/CollectionView/CellFactory.swift +++ b/Sources/CollectionView/CellFactory.swift @@ -1,4 +1,5 @@ import UIKit +import XCTestDynamicOverlay public struct CellFactory<Model> { public struct Registrar { @@ -65,10 +66,10 @@ extension CellFactory { #if DEBUG extension CellFactory { - public static func failing() -> CellFactory { + public static func unimplemented() -> CellFactory { CellFactory( - register: .init { _ in fatalError("Not implemented") }, - build: .init { _, _, _ in fatalError("Not implemented") } + register: .init(register: XCTUnimplemented("\(Self.self).Registrar")), + build: .init(build: XCTUnimplemented("\(Self.self).Builder")) ) } } diff --git a/Sources/CollectionView/ViewConfigurator.swift b/Sources/CollectionView/ViewConfigurator.swift index 67e0453b..eb3e744c 100644 --- a/Sources/CollectionView/ViewConfigurator.swift +++ b/Sources/CollectionView/ViewConfigurator.swift @@ -1,4 +1,5 @@ import UIKit +import XCTestDynamicOverlay public struct ViewConfigurator<View: UIView, Model> { public init(configure: @escaping (View, Model) -> Void) { @@ -14,8 +15,8 @@ public struct ViewConfigurator<View: UIView, Model> { #if DEBUG extension ViewConfigurator { - public static func failing() -> ViewConfigurator { - ViewConfigurator { _, _ in fatalError("Not implemented") } + public static func unimplemented() -> ViewConfigurator { + ViewConfigurator(configure: XCTUnimplemented("\(Self.self)")) } } #endif -- GitLab