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
Branches
Tags
2 merge requests!54Releasing 1.1.4,!51CollectionView library
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"))
)
}
}
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment