-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename CouchTrackerSyncTests.swift to Helpers.swift
- Loading branch information
Pietro Caselani
committed
Jan 1, 2020
1 parent
c9b7297
commit 72f6600
Showing
3 changed files
with
13 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
import Foundation | ||
|
||
private final class TestableClass: NSObject {} | ||
|
||
private let bundle = Bundle(for: TestableClass.self) | ||
|
||
func read(file named: String) -> Data { | ||
return bundle.url(forResource: named, withExtension: "json").map { try! Data(contentsOf: $0) }! | ||
} | ||
|
||
func decode<T: Codable>(file name: String, as type: T.Type) -> T { | ||
return try! JSONDecoder().decode(type, from: read(file: name)) | ||
} |
File renamed without changes.