Skip to content

Commit 4fd3987

Browse files
committed
Fixed some comment typos
Enabled code coverage for unit tests
1 parent d121b90 commit 4fd3987

File tree

7 files changed

+12
-11
lines changed

7 files changed

+12
-11
lines changed

.swiftpm/xcode/xcshareddata/xcschemes/SwiftBloc.xcscheme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES">
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
codeCoverageEnabled = "YES">
3031
<Testables>
3132
<TestableReference
3233
skipped = "NO">

Sources/Base.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Combine
1212
*/
1313
open class Base<State>: ObservableObject where State: Equatable {
1414
/**
15-
Whenever a state will be changed, the instance of the **Cubit** wrapped in **ObservedObject** in your **View** structure will recieve
15+
Whenever a state will be changed, the instance of the **Cubit** wrapped in **ObservedObject** in your **View** structure will receive
1616
a new value of state. Based on this you can set the strict dependency of how to build your views.
1717
*/
1818
@Published internal(set) public var state: State

Sources/BlocObserver.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99

1010
/**
1111
An observer to observe emitted states or added events.
12-
You may creater your own singletone observer class and set a new value for a **shared** property
12+
You may create your own singleton observer class and set a new value for a **shared** property
1313
*/
1414
open class BlocObserver {
1515
/**
@@ -60,7 +60,7 @@ open class BlocObserver {
6060
logInfo("\(bloc), \(transition)")
6161
}
6262
/**
63-
Called when error is occured in **Cubit** or **Bloc** instance.
63+
Called if an error occurs in **Cubit** or **Bloc** instance.
6464
- parameter base: cubit.
6565
- parameter error: a reported error.
6666
*/

Sources/BlocTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final public class BlocTest<S: Equatable, B: Base<S>> {
1616
/// - Parameters:
1717
/// - build: the **Bloc** object closure
1818
/// - act: all potentially happening events should be described here
19-
/// - wait: a delay before listening to state changing
19+
/// - wait: a delay before listening to state change
2020
/// - expect: all expected states based on incoming events
2121
/// - verify: verify bloc for matching expectations of incoming events successfully mapped to expected states
2222
public static func execute(

Sources/BlocView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protocol BlocViewProtocol: View {
3636
*/
3737
public struct BlocView<B: Base<S>, S: Equatable, Content: View>: BlocViewProtocol {
3838
/**
39-
A cubit/bloc property which holds the custom buisiness logic
39+
A cubit/bloc property which holds the custom business logic
4040
*/
4141
@ObservedObject var base: B
4242
/**
@@ -46,16 +46,16 @@ public struct BlocView<B: Base<S>, S: Equatable, Content: View>: BlocViewProtoco
4646
base.state
4747
}
4848
/**
49-
@ViewBuilder callback. Builds views based on the state
49+
@ViewBuilder callback. Builds views based on the state.
5050
*/
5151
private let builder: BlocViewBuilder<B, S, Content>
5252
/**
53-
(Optional) Custom action callback. Called every time when state changes
53+
(Optional) Custom action callback. Called every time the state is changed.
5454
*/
5555
private let action: BlocViewAction<B, S>?
5656
/**
5757
Required property of View Protocol. Body will set the current cubit/bloc instance as **EnvironmentObject** if the instance
58-
is wrapped in **ObservedObject** property wrapper in your View.
58+
is wrapped in an **ObservedObject** property wrapper in your View.
5959
*/
6060
public var body: some View {
6161
build(base: base)

Sources/Cubit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Combine
99

1010
/**
11-
A state managing class not depending on incoming events.
11+
A state managing class not dependent on incoming events.
1212
*/
1313
open class Cubit<State>: Base<State> where State: Equatable {
1414
/**

Tests/MockCounterBloc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct MockCounterState: Equatable {
2323

2424
class MockCounterBloc: Bloc<MockCounterEvent, MockCounterState> {
2525
init() {
26-
super.init(intialState: MockCounterState(count: 0))
26+
super.init(initialState: MockCounterState(count: 0))
2727
}
2828

2929
override func mapEventToState(event: MockCounterEvent) -> MockCounterState {

0 commit comments

Comments
 (0)