Skip to content
This repository was archived by the owner on Oct 6, 2020. It is now read-only.

Commit 834cfdd

Browse files
author
DrBeta
committed
I want this test TO WORK
Ill do tests later
1 parent 8e46679 commit 834cfdd

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/JSONLoader/JSONLoader.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import Foundation
2-
class JSONLoader{
2+
33
public func load<T: Decodable>(_ filename: String, as type:T.Type = T.self) -> T {
44
let data:Data
5-
guard let file = Bundle.main.url(forResource: filename, withExtension: "json")
5+
guard let file = Bundle.main.url(forResource: filename, withExtension: nil)
66
else {
77
fatalError("Couldn't find \(filename) in main bundle.")
88
}
@@ -21,4 +21,4 @@ class JSONLoader{
2121
}
2222
}
2323

24-
}
24+

Tests/JSONLoaderTests/JSONLoaderTests.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ import XCTest
22
@testable import JSONLoader
33

44
final class JSONLoaderTests: XCTestCase {
5-
func testExample() {
6-
// This is an example of a functional test case.
7-
// Use XCTAssert and related functions to verify your tests produce the correct
8-
// results.
9-
5+
struct Person: Codable {
6+
var id:Int
7+
var name:String
8+
}
9+
10+
func testLoadingJSON() {
11+
1012
}
1113

1214
static var allTests = [
13-
("testExample", testExample),
15+
("testLoadingJSON", testLoadingJSON),
1416
]
1517
}

0 commit comments

Comments
 (0)