File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed
Sources/FeatherSpec/Protocols Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,7 @@ extension SpecExecutor {
3030 public func execute(
3131 _ spec: Spec
3232 ) async throws {
33- try await self . execute (
34- req: spec. request,
35- body: spec. body
36- )
33+ try await spec. run ( using: self )
3734 }
3835
3936 /// Executes a given `SpecBuilder` asynchronously.
@@ -42,7 +39,8 @@ extension SpecExecutor {
4239 public func execute(
4340 _ builder: SpecBuilder
4441 ) async throws {
45- try await execute ( builder. build ( ) )
42+ let spec = builder. build ( )
43+ try await spec. run ( using: self )
4644 }
4745
4846 /// Executes a given `SpecBuilderParameter` asynchronously using a builder block.
@@ -51,10 +49,10 @@ extension SpecExecutor {
5149 public func execute(
5250 @SpecBuilder parameterBuilderBlock: ( ) -> SpecBuilderParameter
5351 ) async throws {
54- try await execute (
55- . init(
56- parameterBuilderBlock: parameterBuilderBlock
57- )
52+ let spec = SpecBuilder (
53+ parameterBuilderBlock: parameterBuilderBlock
5854 )
55+ . build ( )
56+ try await spec. run ( using: self )
5957 }
6058}
Original file line number Diff line number Diff line change @@ -192,6 +192,9 @@ final class FeatherSpecTests: XCTestCase {
192192 func testExecutorSpec( ) async throws {
193193 let spec = SpecBuilder {
194194 Expect ( . ok)
195+ Expect { response, body in
196+ XCTAssertEqual ( response. status. code, 200 )
197+ }
195198 }
196199 . build ( )
197200
@@ -202,6 +205,9 @@ final class FeatherSpecTests: XCTestCase {
202205 func testExecutorSpecBuilder( ) async throws {
203206 let specBuilder = SpecBuilder {
204207 Expect ( . ok)
208+ Expect { response, body in
209+ XCTAssertEqual ( response. status. code, 200 )
210+ }
205211 }
206212
207213 let executor = PostTodoExecutor ( todo: todo)
@@ -212,6 +218,9 @@ final class FeatherSpecTests: XCTestCase {
212218 let executor = PostTodoExecutor ( todo: todo)
213219 try await executor. execute {
214220 Expect ( . ok)
221+ Expect { response, body in
222+ XCTAssertEqual ( response. status. code, 200 )
223+ }
215224 }
216225 }
217226}
You can’t perform that action at this time.
0 commit comments