@@ -18,6 +18,11 @@ extension Spy {
18
18
self . init ( . pending( fallback: . failure( pendingFailure) ) )
19
19
}
20
20
21
+ /// Create a throwing pendable Spy that is pre-stubbed to return a pending that will block for a bit before throwing an error
22
+ public convenience init < Success: Sendable > ( ) where Returning == ThrowingPendable < Success , Error > {
23
+ self . init ( . pending( fallback: . failure( EmptyError ( ) ) ) )
24
+ }
25
+
21
26
/// Create a throwing pendable Spy that is pre-stubbed to return a finished & successful value.
22
27
public convenience init < Success: Sendable , Failure: Error > ( success: Success ) where Returning == ThrowingPendable < Success , Failure > {
23
28
self . init ( . finished( . success( success) ) )
@@ -54,7 +59,7 @@ extension Spy {
54
59
55
60
/// Update the pendable Spy's stub to be in a pending state with a default failure value.
56
61
public func stubPendingFailure< Success: Sendable > ( ) where Returning == ThrowingPendable < Success , Error > {
57
- self . stub ( pendingFailure: PendableDefaultError ( ) )
62
+ self . stub ( pendingFailure: EmptyError ( ) )
58
63
}
59
64
60
65
/// Update the throwing pendable Spy's stub to be successful, with the given value.
@@ -73,7 +78,7 @@ extension Spy {
73
78
74
79
/// Update the throwing pendable Spy's stub to throw an error.
75
80
public func stubFailure< Success: Sendable > ( ) where Returning == ThrowingPendable < Success , Error > {
76
- self . stub ( failure: PendableDefaultError ( ) )
81
+ self . stub ( failure: EmptyError ( ) )
77
82
}
78
83
}
79
84
0 commit comments