-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Sources/VaporTestTools/Extensions/Services/Services+Testing.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// Services+Testing.swift | ||
// VaporTestTools | ||
// | ||
// Created by Ondrej Rafaj on 20/03/2018. | ||
// | ||
|
||
import Foundation | ||
@testable import Service | ||
|
||
|
||
extension TestableProperty where TestableType == Services { | ||
|
||
public mutating func remove<S>(type: S.Type) { | ||
if let existing = element.factories.index(where: { | ||
$0.serviceType is S.Type | ||
}) { | ||
element.factories.remove(at: existing) | ||
} | ||
} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters