| 123456789101112131415161718192021222324252627 |
- //
- // LoopKitTests.swift
- // LoopKitTests
- //
- // Created by Nathan Racklyeft on 1/18/16.
- // Copyright © 2016 Nathan Racklyeft. All rights reserved.
- //
- import XCTest
- import Foundation
- public typealias JSONDictionary = [String: Any]
- extension XCTestCase {
- public var bundle: Bundle {
- return Bundle(for: type(of: self))
- }
- public func loadFixture<T>(_ resourceName: String) -> T {
- guard let path = bundle.path(forResource: resourceName, ofType: "json") else {
- preconditionFailure("Could not find fixture: \(resourceName)")
- }
- return try! JSONSerialization.jsonObject(with: Data(contentsOf: URL(fileURLWithPath: path)), options: []) as! T
- }
- }
|