diff --git a/MobiusCore/Source/ConnectableConvenienceClasses/ActionConnectable.swift b/MobiusCore/Source/ConnectableConvenienceClasses/ActionConnectable.swift index ac93e70d..4660bdf3 100644 --- a/MobiusCore/Source/ConnectableConvenienceClasses/ActionConnectable.swift +++ b/MobiusCore/Source/ConnectableConvenienceClasses/ActionConnectable.swift @@ -29,7 +29,7 @@ open class ActionConnectable: Connectable { /// /// - Parameter action: Called when the `connection`’s `accept` function is called. public init(_ action: @escaping () -> Void) { - innerConnectable = ClosureConnectable({ _ in + innerConnectable = ClosureConnectable({ _ in action() }) } diff --git a/MobiusCore/Source/ConnectableConvenienceClasses/BlockingFunctionConnectable.swift b/MobiusCore/Source/ConnectableConvenienceClasses/BlockingFunctionConnectable.swift index d891ce53..b74bfb11 100644 --- a/MobiusCore/Source/ConnectableConvenienceClasses/BlockingFunctionConnectable.swift +++ b/MobiusCore/Source/ConnectableConvenienceClasses/BlockingFunctionConnectable.swift @@ -29,7 +29,7 @@ open class BlockingFunctionConnectable: Connectable { /// /// - Parameter function: Called when the `connection`’s `accept` function is called. public init(_ function: @escaping (Input) -> Output) { - innerConnectable = ClosureConnectable(function) + innerConnectable = ClosureConnectable(function) } public func connect(_ consumer: @escaping Consumer) -> Connection { diff --git a/MobiusCore/Source/ConnectableConvenienceClasses/ConsumerConnectable.swift b/MobiusCore/Source/ConnectableConvenienceClasses/ConsumerConnectable.swift index 6e3d4ab6..ed237e30 100644 --- a/MobiusCore/Source/ConnectableConvenienceClasses/ConsumerConnectable.swift +++ b/MobiusCore/Source/ConnectableConvenienceClasses/ConsumerConnectable.swift @@ -29,7 +29,7 @@ open class ConsumerConnectable: Connectable { /// /// - Parameter consumer: Called when the `connection`’s `accept` function is called. public init(_ consumer: @escaping Consumer) { - innerConnectable = ClosureConnectable(consumer) + innerConnectable = ClosureConnectable(consumer) } public func connect(_ consumer: @escaping Consumer) -> Connection { diff --git a/MobiusCore/Source/EffectHandlers/EffectRouterDSL.swift b/MobiusCore/Source/EffectHandlers/EffectRouterDSL.swift index 8931f2b7..05241ca7 100644 --- a/MobiusCore/Source/EffectHandlers/EffectRouterDSL.swift +++ b/MobiusCore/Source/EffectHandlers/EffectRouterDSL.swift @@ -35,7 +35,7 @@ public extension _PartialEffectRouter { func to( _ handle: @escaping (EffectParameters, EffectCallback) -> Disposable ) -> EffectRouter { - return to(AnyEffectHandler(handle: handle)) + return to(AnyEffectHandler(handle: handle)) } /// Route to a side-effecting closure. diff --git a/MobiusCore/Source/EventSources/CompositeEventSourceBuilder.swift b/MobiusCore/Source/EventSources/CompositeEventSourceBuilder.swift index fda5ae9d..035536ba 100644 --- a/MobiusCore/Source/EventSources/CompositeEventSourceBuilder.swift +++ b/MobiusCore/Source/EventSources/CompositeEventSourceBuilder.swift @@ -34,7 +34,7 @@ public struct CompositeEventSourceBuilder { /// Returns a new `CompositeEventSourceBuilder` with the specified event source added to it. public func addEventSource(_ source: Source) -> CompositeEventSourceBuilder where Source.Event == Event { - let sources = eventSources + [AnyEventSource(source)] + let sources = eventSources + [AnyEventSource(source)] return CompositeEventSourceBuilder(eventSources: sources) } @@ -45,7 +45,7 @@ public struct CompositeEventSourceBuilder { public func build() -> AnyEventSource { switch eventSources.count { case 0: - return AnyEventSource { _ in AnonymousDisposable {} } + return AnyEventSource { _ in AnonymousDisposable {} } case 1: return eventSources[0] default: diff --git a/MobiusCore/Test/AnyConnectionTests.swift b/MobiusCore/Test/AnyConnectionTests.swift index 09c57d9c..7a2d5b5c 100644 --- a/MobiusCore/Test/AnyConnectionTests.swift +++ b/MobiusCore/Test/AnyConnectionTests.swift @@ -32,7 +32,7 @@ class ConnectionTests: QuickSpec { beforeEach { let acceptClosure = { (value: Int) in acceptValue = value } let disposeClosure = { disposeCalled = true } - connection = Connection(acceptClosure: acceptClosure, disposeClosure: disposeClosure) + connection = Connection(acceptClosure: acceptClosure, disposeClosure: disposeClosure) } afterEach { diff --git a/MobiusCore/Test/EffectHandlers/AnyEffectHandlerTests.swift b/MobiusCore/Test/EffectHandlers/AnyEffectHandlerTests.swift index ff1492ff..5dbbd141 100644 --- a/MobiusCore/Test/EffectHandlers/AnyEffectHandlerTests.swift +++ b/MobiusCore/Test/EffectHandlers/AnyEffectHandlerTests.swift @@ -37,7 +37,7 @@ class AnyEffectHandlerTests: QuickSpec { sharedExamples("expected AnyEffectHandler behaviour") { it("invokes send and end") { - let callback = EffectCallback( + let callback = EffectCallback( onSend: { receivedEvents.append("e-" + $0) }, onEnd: { receivedEvents.append("end") } ) diff --git a/MobiusCore/Test/EffectHandlers/EffectHandlerTests.swift b/MobiusCore/Test/EffectHandlers/EffectHandlerTests.swift index 72019dce..45437c82 100644 --- a/MobiusCore/Test/EffectHandlers/EffectHandlerTests.swift +++ b/MobiusCore/Test/EffectHandlers/EffectHandlerTests.swift @@ -45,7 +45,7 @@ class EffectHandlerTests: QuickSpec { beforeEach { effectHandler = AnyEffectHandler(handle: handleEffect) receivedEvents = [] - let callback = EffectCallback( + let callback = EffectCallback( onSend: { event in receivedEvents.append(event) }, diff --git a/MobiusCore/Test/EffectHandlers/EffectRouterTests.swift b/MobiusCore/Test/EffectHandlers/EffectRouterTests.swift index c923ea38..7815cb14 100644 --- a/MobiusCore/Test/EffectHandlers/EffectRouterTests.swift +++ b/MobiusCore/Test/EffectHandlers/EffectRouterTests.swift @@ -187,7 +187,7 @@ class EffectRouterTests: QuickSpec { context("Router Disposing on Deinit") { it("should dispose active `EffectHandler`s when deinitializing") { var wasDisposed = false - var connection: Connection? = EffectRouter() + var connection: Connection? = EffectRouter() .routeEffects(equalTo: .effect1) .to { _, _ in return AnonymousDisposable { @@ -214,7 +214,7 @@ private class TestConnectable: Connectable { self.onDispose = onDispose } func connect(_ consumer: @escaping (Event) -> Void) -> Connection { - Connection( + Connection( acceptClosure: { _ in consumer(self.event) }, disposeClosure: onDispose ) diff --git a/MobiusCore/Test/FirstTests.swift b/MobiusCore/Test/FirstTests.swift index 0bb2ebae..38c2392e 100644 --- a/MobiusCore/Test/FirstTests.swift +++ b/MobiusCore/Test/FirstTests.swift @@ -33,7 +33,7 @@ class FirstTests: QuickSpec { describe("public initializer") { beforeEach { - sut = First(model: "a", effects: [.send]) + sut = First(model: "a", effects: [.send]) } it("should set the model property") { diff --git a/MobiusCore/Test/MobiusLoopTests.swift b/MobiusCore/Test/MobiusLoopTests.swift index 049bc227..08ead3d9 100644 --- a/MobiusCore/Test/MobiusLoopTests.swift +++ b/MobiusCore/Test/MobiusLoopTests.swift @@ -148,8 +148,8 @@ class MobiusLoopTests: QuickSpec { update: Update { _, _ in .noChange }, publisher: ConnectablePublisher() ) - modelPublisher = ConnectablePublisher() - disposable = ConnectablePublisher() + modelPublisher = ConnectablePublisher() + disposable = ConnectablePublisher() loop = MobiusLoop( eventProcessor: eventProcessor, diff --git a/MobiusCore/Test/TestingUtil.swift b/MobiusCore/Test/TestingUtil.swift index aa73ea27..0e75d2b6 100644 --- a/MobiusCore/Test/TestingUtil.swift +++ b/MobiusCore/Test/TestingUtil.swift @@ -44,7 +44,7 @@ class SimpleTestConnectable: Connectable { var disposed = false func connect(_ consumer: @escaping (String) -> Void) -> Connection { - return Connection(acceptClosure: { _ in }, disposeClosure: { [weak self] in self?.disposed = true }) + return Connection(acceptClosure: { _ in }, disposeClosure: { [weak self] in self?.disposed = true }) } } @@ -58,7 +58,7 @@ class RecordingTestConnectable: Connectable { private let expectedQueue: DispatchQueue? init(expectedQueue: DispatchQueue? = nil) { - recorder = Recorder() + recorder = Recorder() self.expectedQueue = expectedQueue } diff --git a/MobiusExtras/Source/ConnectableContramap.swift b/MobiusExtras/Source/ConnectableContramap.swift index cdfaf8c4..05e0d2bb 100644 --- a/MobiusExtras/Source/ConnectableContramap.swift +++ b/MobiusExtras/Source/ConnectableContramap.swift @@ -34,7 +34,7 @@ public extension Connectable { ) } - let contramapped = AnyConnectable(newConnectClosure) + let contramapped = AnyConnectable(newConnectClosure) return contramapped } diff --git a/MobiusExtras/Test/ConnectableContramapTests.swift b/MobiusExtras/Test/ConnectableContramapTests.swift index 69633b90..5b238f67 100644 --- a/MobiusExtras/Test/ConnectableContramapTests.swift +++ b/MobiusExtras/Test/ConnectableContramapTests.swift @@ -43,7 +43,7 @@ class ConnectableContramapTests: QuickSpec { } beforeEach { - connectable = AnyConnectable({ (consumer: @escaping Consumer) -> Connection in + connectable = AnyConnectable({ (consumer: @escaping Consumer) -> Connection in Connection(acceptClosure: consumer, disposeClosure: dispose) }) diff --git a/MobiusNimble/Test/NimbleFirstMatchersTests.swift b/MobiusNimble/Test/NimbleFirstMatchersTests.swift index 13108987..5a93dcf3 100644 --- a/MobiusNimble/Test/NimbleFirstMatchersTests.swift +++ b/MobiusNimble/Test/NimbleFirstMatchersTests.swift @@ -45,7 +45,7 @@ class NimbleFirstMatchersTests: QuickSpec { let model = "3" func testInitiate(model: String) -> First { - return First(model: model, effects: ["2", "4"]) + return First(model: model, effects: ["2", "4"]) } // Testing through proxy: UpdateSpec diff --git a/MobiusNimble/Test/NimbleNextMatchersTests.swift b/MobiusNimble/Test/NimbleNextMatchersTests.swift index 7d45a107..718b7a75 100644 --- a/MobiusNimble/Test/NimbleNextMatchersTests.swift +++ b/MobiusNimble/Test/NimbleNextMatchersTests.swift @@ -55,7 +55,7 @@ class NimbleNextMatchersTests: QuickSpec { // Testing through proxy: UpdateSpec context("when asserting through predicates that fail") { beforeEach { - UpdateSpec(testUpdate) + UpdateSpec(testUpdate) .given("a model") .when("") .then(assertThatNext(haveNoModel(), haveNoEffects())) diff --git a/MobiusTest/Test/FirstMatchersTests.swift b/MobiusTest/Test/FirstMatchersTests.swift index bafc2148..d72050b9 100644 --- a/MobiusTest/Test/FirstMatchersTests.swift +++ b/MobiusTest/Test/FirstMatchersTests.swift @@ -30,7 +30,7 @@ class FirstMatchersTests: QuickSpec { let model = "3" func testInitiate(model: String) -> First { - return First(model: model, effects: ["2", "4"]) + return First(model: model, effects: ["2", "4"]) } func failureDetector(message: String, file: StaticString, line: UInt) { diff --git a/MobiusTest/Test/InitSpecTests.swift b/MobiusTest/Test/InitSpecTests.swift index a75420b3..e001e466 100644 --- a/MobiusTest/Test/InitSpecTests.swift +++ b/MobiusTest/Test/InitSpecTests.swift @@ -37,7 +37,7 @@ class InitSpecTests: QuickSpec { testModel = UUID().uuidString testEffects = ["1", "2", "3"] initiate = { (model: String) in - First(model: model + model, effects: testEffects) + First(model: model + model, effects: testEffects) } spec = InitSpec(initiate) diff --git a/MobiusTest/Test/NextMatchersTests.swift b/MobiusTest/Test/NextMatchersTests.swift index 5f230916..f1bb0c59 100644 --- a/MobiusTest/Test/NextMatchersTests.swift +++ b/MobiusTest/Test/NextMatchersTests.swift @@ -49,7 +49,7 @@ class XCTestNextMatchersTests: QuickSpec { // Testing through proxy: UpdateSpec context("when asserting through predicates that fail") { beforeEach { - UpdateSpec(testUpdate) + UpdateSpec(testUpdate) .given("a model") .when("") .then(assertThatNext( diff --git a/MobiusTest/Test/UpdateSpecTests.swift b/MobiusTest/Test/UpdateSpecTests.swift index 380e8f2e..98b5cfb0 100644 --- a/MobiusTest/Test/UpdateSpecTests.swift +++ b/MobiusTest/Test/UpdateSpecTests.swift @@ -43,7 +43,7 @@ enum MyEffect { class UpdateSpecTests: QuickSpec { // swiftlint:disable function_body_length override func spec() { - let updateSpec = UpdateSpec(myUpdate) + let updateSpec = UpdateSpec(myUpdate) describe("UpdateSpec") { describe("single events") {