@@ -7,53 +7,53 @@ private struct StubError: Error, CustomDebugStringConvertible {
7
7
8
8
final class BeSuccessTest : XCTestCase {
9
9
func testPositiveMatch( ) {
10
- let successfulResult : Result < Int , Error > = . success( 1 )
11
- expect ( successfulResult ) . to ( beSuccess ( ) )
10
+ let result : Result < Int , Error > = . success( 1 )
11
+ expect ( result ) . to ( beSuccess ( ) )
12
12
}
13
13
14
14
func testPositiveMatchWithValueTesting( ) {
15
15
let stubValue = 1
16
- let successfulResult : Result < Int , Error > = . success( stubValue)
17
- expect ( successfulResult ) . to ( beSuccess { value in
16
+ let result : Result < Int , Error > = . success( stubValue)
17
+ expect ( result ) . to ( beSuccess { value in
18
18
expect ( value) . to ( equal ( stubValue) )
19
19
} )
20
20
}
21
21
22
22
func testNegativeMatch( ) {
23
- let failureResult : Result < Int , Error > = . failure( StubError ( ) )
24
- expect ( failureResult ) . toNot ( beSuccess ( ) )
23
+ let result : Result < Int , Error > = . failure( StubError ( ) )
24
+ expect ( result ) . toNot ( beSuccess ( ) )
25
25
}
26
26
27
27
func testExpectationFailureMessage( ) {
28
- let failureResult : Result < Int , Error > = . failure( StubError ( ) )
29
- failsWithErrorMessage ( " expected to be <success>, got < failure(StubError)> " ) {
30
- expect ( failureResult ) . to ( beSuccess ( ) )
28
+ failsWithErrorMessage ( " expected to be <success( Int)>, got < failure(StubError)> " ) {
29
+ let result : Result < Int , Error > = . failure( StubError ( ) )
30
+ expect ( result ) . to ( beSuccess ( ) )
31
31
}
32
32
}
33
33
}
34
34
35
35
final class BeFailureTest : XCTestCase {
36
36
func testPositiveMatch( ) {
37
- let failureResult : Result < Int , Error > = . failure( StubError ( ) )
38
- expect ( failureResult ) . to ( beFailure ( ) )
37
+ let result : Result < Int , Error > = . failure( StubError ( ) )
38
+ expect ( result ) . to ( beFailure ( ) )
39
39
}
40
40
41
41
func testPositiveMatchWithValueTesting( ) {
42
- let failureResult : Result < Int , Error > = . failure( StubError ( ) )
43
- expect ( failureResult ) . to ( beFailure { value in
44
- expect ( value ) . to ( matchError ( StubError . self) )
42
+ let result : Result < Int , Error > = . failure( StubError ( ) )
43
+ expect ( result ) . to ( beFailure { error in
44
+ expect ( error ) . to ( matchError ( StubError . self) )
45
45
} )
46
46
}
47
47
48
48
func testNegativeMatch( ) {
49
- let successfulResult : Result < Int , Error > = . success( 1 )
50
- expect ( successfulResult ) . toNot ( beFailure ( ) )
49
+ let result : Result < Int , Error > = . success( 1 )
50
+ expect ( result ) . toNot ( beFailure ( ) )
51
51
}
52
52
53
53
func testExpectationFailureMessage( ) {
54
- let successfulResult : Result < Int , Error > = . success( 1 )
55
- failsWithErrorMessage ( " expected to be <failure>, got < success(1)> " ) {
56
- expect ( successfulResult ) . to ( beFailure ( ) )
54
+ failsWithErrorMessage ( " expected to be <failure( Error)>, got < success(1)> " ) {
55
+ let result : Result < Int , Error > = . success( 1 )
56
+ expect ( result ) . to ( beFailure ( ) )
57
57
}
58
58
}
59
59
}
0 commit comments