Skip to content

Commit

Permalink
Merge pull request #361 from mas-cli/clean
Browse files Browse the repository at this point in the history
♻️ Remove unused test helpers
  • Loading branch information
phatblat authored May 7, 2021
2 parents 585699d + e3e82cc commit c88a988
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 124 deletions.
15 changes: 0 additions & 15 deletions Tests/MasKitTests/Network/NetworkSessionMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,6 @@ class NetworkSessionMock: NetworkSession {
var data: Data?
var error: Error?

/// Creates a mock data task
///
/// - Parameters:
/// - url: unused
/// - completionHandler: Closure which is delivered both data and error properties (only one should be non-nil)
/// - Returns: Mock data task
func dataTask(with _: URL, completionHandler: @escaping CompletionHandler) -> URLSessionDataTask {
let data = self.data
let error = self.error

return URLSessionDataTaskMock {
completionHandler(data, nil, error)
}
}

/// Immediately passes data and error to completion handler.
///
/// - Parameters:
Expand Down
41 changes: 0 additions & 41 deletions Tests/MasKitTests/Network/TestURLSessionDelegate.swift

This file was deleted.

31 changes: 0 additions & 31 deletions Tests/MasKitTests/Network/URLSessionConfiguration+Tests.swift

This file was deleted.

24 changes: 0 additions & 24 deletions Tests/MasKitTests/Network/URLSessionDataTaskMock.swift

This file was deleted.

14 changes: 1 addition & 13 deletions Tests/MasKitTests/Strongify.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,7 @@

// https://medium.com/@merowing_/stop-weak-strong-dance-in-swift-3aec6d3563d4

func strongify<Context: AnyObject, Arguments>(
_ context: Context?,
closure: @escaping (Context, Arguments) -> Void
) -> (Arguments) -> Void {
let strongified = { [weak context] (arguments: Arguments) in
guard let strongContext = context else { return }
closure(strongContext, arguments)
}

return strongified
}

func strongify<Context: AnyObject>(_ context: Context?, closure: @escaping (Context) -> Void) {
func strongify<Context: AnyObject>(_ context: Context?, closure: (Context) -> Void) {
guard let strongContext = context else { return }
closure(strongContext)
}

0 comments on commit c88a988

Please sign in to comment.