Skip to content
Snippets Groups Projects
Commit 488a741d authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Use dynamic overlay for unimplemented stuff

parent 118bad43
No related branches found
No related tags found
2 merge requests!54Releasing 1.1.4,!51CollectionView library
import UIKit import UIKit
import XCTestDynamicOverlay
public struct CellFactory<Model> { public struct CellFactory<Model> {
public struct Registrar { public struct Registrar {
...@@ -65,10 +66,10 @@ extension CellFactory { ...@@ -65,10 +66,10 @@ extension CellFactory {
#if DEBUG #if DEBUG
extension CellFactory { extension CellFactory {
public static func failing() -> CellFactory { public static func unimplemented() -> CellFactory {
CellFactory( CellFactory(
register: .init { _ in fatalError("Not implemented") }, register: .init(register: XCTUnimplemented("\(Self.self).Registrar")),
build: .init { _, _, _ in fatalError("Not implemented") } build: .init(build: XCTUnimplemented("\(Self.self).Builder"))
) )
} }
} }
......
import UIKit import UIKit
import XCTestDynamicOverlay
public struct ViewConfigurator<View: UIView, Model> { public struct ViewConfigurator<View: UIView, Model> {
public init(configure: @escaping (View, Model) -> Void) { public init(configure: @escaping (View, Model) -> Void) {
...@@ -14,8 +15,8 @@ public struct ViewConfigurator<View: UIView, Model> { ...@@ -14,8 +15,8 @@ public struct ViewConfigurator<View: UIView, Model> {
#if DEBUG #if DEBUG
extension ViewConfigurator { extension ViewConfigurator {
public static func failing() -> ViewConfigurator { public static func unimplemented() -> ViewConfigurator {
ViewConfigurator { _, _ in fatalError("Not implemented") } ViewConfigurator(configure: XCTUnimplemented("\(Self.self)"))
} }
} }
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment