Skip to content

Commit 6b8a45f

Browse files
committed
Fixing fixture paths in SPM and Xcodeproj.
1 parent 0fb0f1f commit 6b8a45f

File tree

11 files changed

+29
-34
lines changed

11 files changed

+29
-34
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.

FilestackSDK.xcodeproj/project.pbxproj

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
45825B3F2524DE5D002F3310 /* TransformableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_174 /* TransformableTests.swift */; };
2323
45825B402524DE5D002F3310 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_175 /* UploadTests.swift */; };
2424
45825B412524DE5D002F3310 /* UploadableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_176 /* UploadableTests.swift */; };
25-
45825B472524DE8D002F3310 /* sample.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 45825B452524DE8D002F3310 /* sample.jpg */; };
26-
45825B482524DE8D002F3310 /* large.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 45825B462524DE8D002F3310 /* large.jpg */; };
2725
45825B6B2524E03B002F3310 /* OHHTTPStubs in Frameworks */ = {isa = PBXBuildFile; productRef = 45825B6A2524E03B002F3310 /* OHHTTPStubs */; };
2826
45825B6D2524E03B002F3310 /* OHHTTPStubsSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 45825B6C2524E03B002F3310 /* OHHTTPStubsSwift */; };
2927
45825B712524E07F002F3310 /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45825B702524E07F002F3310 /* Helpers.swift */; };
@@ -162,6 +160,7 @@
162160
4586F1842524EFF8008F282E /* FSMetadataOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 45825C1D2524E389002F3310 /* FSMetadataOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
163161
4586F1882524EFFC008F282E /* FSTransformPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 45825C1E2524E389002F3310 /* FSTransformPosition.h */; settings = {ATTRIBUTES = (Public, ); }; };
164162
4586F19E2524F1CF008F282E /* FilestackSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 4586F1652524EEB8008F282E /* FilestackSDK.h */; settings = {ATTRIBUTES = (Public, ); }; };
163+
4586F1C42524FD7E008F282E /* Fixtures in Resources */ = {isa = PBXBuildFile; fileRef = 4586F1C32524FD7E008F282E /* Fixtures */; };
165164
/* End PBXBuildFile section */
166165

167166
/* Begin PBXContainerItemProxy section */
@@ -176,8 +175,6 @@
176175

177176
/* Begin PBXFileReference section */
178177
45825B262524DE46002F3310 /* FilestackSDKTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FilestackSDKTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
179-
45825B452524DE8D002F3310 /* sample.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = sample.jpg; sourceTree = "<group>"; };
180-
45825B462524DE8D002F3310 /* large.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = large.jpg; sourceTree = "<group>"; };
181178
45825B702524E07F002F3310 /* Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = "<group>"; };
182179
45825B742524E315002F3310 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = SOURCE_ROOT; };
183180
45825B872524E389002F3310 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
@@ -314,9 +311,9 @@
314311
45825C1C2524E389002F3310 /* FSPolicyCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSPolicyCall.h; sourceTree = "<group>"; };
315312
45825C1D2524E389002F3310 /* FSMetadataOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSMetadataOptions.h; sourceTree = "<group>"; };
316313
45825C1E2524E389002F3310 /* FSTransformPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSTransformPosition.h; sourceTree = "<group>"; };
317-
45825C1F2524E389002F3310 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
318314
45825C202524E389002F3310 /* ObjcDefs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ObjcDefs.m; sourceTree = "<group>"; };
319315
4586F1652524EEB8008F282E /* FilestackSDK.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilestackSDK.h; sourceTree = "<group>"; };
316+
4586F1C32524FD7E008F282E /* Fixtures */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Fixtures; sourceTree = "<group>"; };
320317
"FilestackSDK::FilestackSDK::Product" /* FilestackSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = FilestackSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
321318
OBJ_164 /* BaseOperationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseOperationTests.swift; sourceTree = "<group>"; };
322319
OBJ_165 /* ClientTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientTests.swift; sourceTree = "<group>"; };
@@ -364,15 +361,6 @@
364361
name = Frameworks;
365362
sourceTree = "<group>";
366363
};
367-
45825B442524DE8D002F3310 /* Fixtures */ = {
368-
isa = PBXGroup;
369-
children = (
370-
45825B452524DE8D002F3310 /* sample.jpg */,
371-
45825B462524DE8D002F3310 /* large.jpg */,
372-
);
373-
path = Fixtures;
374-
sourceTree = "<group>";
375-
};
376364
45825B842524E389002F3310 /* Sources */ = {
377365
isa = PBXGroup;
378366
children = (
@@ -645,7 +633,6 @@
645633
isa = PBXGroup;
646634
children = (
647635
45825C1B2524E389002F3310 /* include */,
648-
45825C1F2524E389002F3310 /* module.modulemap */,
649636
45825C202524E389002F3310 /* ObjcDefs.m */,
650637
);
651638
path = ObjcDefs;
@@ -672,6 +659,7 @@
672659
OBJ_163 /* FilestackSDKTests */ = {
673660
isa = PBXGroup;
674661
children = (
662+
4586F1C32524FD7E008F282E /* Fixtures */,
675663
45825B742524E315002F3310 /* VERSION */,
676664
OBJ_164 /* BaseOperationTests.swift */,
677665
OBJ_165 /* ClientTests.swift */,
@@ -687,7 +675,6 @@
687675
OBJ_174 /* TransformableTests.swift */,
688676
OBJ_176 /* UploadableTests.swift */,
689677
OBJ_175 /* UploadTests.swift */,
690-
45825B442524DE8D002F3310 /* Fixtures */,
691678
);
692679
name = FilestackSDKTests;
693680
path = Tests/FilestackSDKTests;
@@ -816,9 +803,8 @@
816803
isa = PBXResourcesBuildPhase;
817804
buildActionMask = 2147483647;
818805
files = (
806+
4586F1C42524FD7E008F282E /* Fixtures in Resources */,
819807
45825B752524E315002F3310 /* VERSION in Resources */,
820-
45825B472524DE8D002F3310 /* sample.jpg in Resources */,
821-
45825B482524DE8D002F3310 /* large.jpg in Resources */,
822808
);
823809
runOnlyForDeploymentPostprocessing = 0;
824810
};

Sources/ObjcDefs/include/FSMetadataOptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright © 2017 Filestack. All rights reserved.
77
//
88

9+
#import <Foundation/Foundation.h>
10+
911
/// Represents a metadata option.
1012
typedef NS_OPTIONS(NSUInteger, FSMetadataOptions) {
1113

Sources/ObjcDefs/include/FSPolicyCall.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright © 2017 Filestack. All rights reserved.
77
//
88

9+
#import <Foundation/Foundation.h>
10+
911
/// Represents a policy call type.
1012
///
1113
/// See [Creating Policies](https://www.filestack.com/docs/security/creating-policies) for more information about policy

Sources/ObjcDefs/include/FSTransformPosition.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright © 2017 Filestack. All rights reserved.
77
//
88

9+
#import <Foundation/Foundation.h>
10+
911
/// Represents an image transform position type.
1012
typedef NS_OPTIONS(NSUInteger, FSTransformPosition) {
1113

Sources/ObjcDefs/module.modulemap

Lines changed: 0 additions & 4 deletions
This file was deleted.

Tests/FilestackSDKTests/FileLinkTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class FileLinkTests: XCTestCase {
6262

6363
func testGetExistingContent() {
6464
stub(condition: cdnStubConditions) { _ in
65-
let stubPath = Helpers.url(forResource: "sample", withExtension: "jpg")!.path
65+
let stubPath = Helpers.url(forResource: "sample", withExtension: "jpg", subdirectory: "Fixtures")!.path
6666

6767
let httpHeaders: [AnyHashable: Any] = [
6868
"Content-Type": "image/jpeg",
@@ -184,7 +184,7 @@ class FileLinkTests: XCTestCase {
184184

185185
func testGetContentWithDownloadProgressMonitoring() {
186186
stub(condition: cdnStubConditions) { _ in
187-
let stubPath = Helpers.url(forResource: "sample", withExtension: "jpg")!.path
187+
let stubPath = Helpers.url(forResource: "sample", withExtension: "jpg", subdirectory: "Fixtures")!.path
188188

189189
let httpHeaders: [AnyHashable: Any] = [
190190
"Content-Type": "image/jpeg",
@@ -257,7 +257,7 @@ class FileLinkTests: XCTestCase {
257257

258258
func testDownloadExistingContent() {
259259
stub(condition: cdnStubConditions) { _ in
260-
let stubPath = Helpers.url(forResource: "sample", withExtension: "jpg")!.path
260+
let stubPath = Helpers.url(forResource: "sample", withExtension: "jpg", subdirectory: "Fixtures")!.path
261261

262262
let httpHeaders: [AnyHashable: Any] = [
263263
"Content-Type": "image/jpeg",
@@ -352,7 +352,7 @@ class FileLinkTests: XCTestCase {
352352

353353
func testDownloadWithDownloadProgressMonitoring() {
354354
stub(condition: cdnStubConditions) { _ in
355-
let stubPath = Helpers.url(forResource: "sample", withExtension: "jpg")!.path
355+
let stubPath = Helpers.url(forResource: "sample", withExtension: "jpg", subdirectory: "Fixtures")!.path
356356

357357
let httpHeaders: [AnyHashable: Any] = [
358358
"Content-Type": "image/jpeg",
@@ -442,7 +442,7 @@ class FileLinkTests: XCTestCase {
442442

443443
let client = Client(apiKey: "MY-API-KEY")
444444
let fileLink = client.fileLink(for: "MY-HANDLE")
445-
let fileURL = Helpers.url(forResource: "sample", withExtension: "jpg")!
445+
let fileURL = Helpers.url(forResource: "sample", withExtension: "jpg", subdirectory: "Fixtures")!
446446
let expectation = self.expectation(description: "request should complete")
447447
var response: FilestackSDK.DataResponse?
448448

@@ -520,7 +520,7 @@ class FileLinkTests: XCTestCase {
520520

521521
let client = Client(apiKey: "MY-API-KEY")
522522
let fileLink = client.fileLink(for: "MY-HANDLE")
523-
let fileURL = Helpers.url(forResource: "sample", withExtension: "jpg")!
523+
let fileURL = Helpers.url(forResource: "sample", withExtension: "jpg", subdirectory: "Fixtures")!
524524
let expectation = self.expectation(description: "request should complete")
525525
var response: FilestackSDK.DataResponse?
526526

Tests/FilestackSDKTests/Helpers.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
import Foundation
99

1010
class Helpers {
11-
static func url(forResource resource: String, withExtension ext: String?) -> URL? {
11+
static func url(forResource resource: String, withExtension ext: String?, subdirectory: String?) -> URL? {
1212
#if SWIFT_PACKAGE
1313
let bundle = Bundle.module
1414
#else
1515
let bundle = Bundle(for: Helpers.self)
1616
#endif
1717

18-
return bundle.url(forResource: resource, withExtension: ext)
18+
return bundle.url(forResource: resource, withExtension: ext, subdirectory: subdirectory)
1919
}
2020
}

Tests/FilestackSDKTests/SessionManagerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class SessionManagerTests: XCTestCase {
3636

3737
private extension SessionManagerTests {
3838
var shortVersionString: String {
39-
let url = Helpers.url(forResource: "VERSION", withExtension: nil)!
39+
let url = Helpers.url(forResource: "VERSION", withExtension: nil, subdirectory: nil)!
4040

4141
return String(data: try! Data(contentsOf: url), encoding: .utf8)!
4242
.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)

Tests/FilestackSDKTests/UploadTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import XCTest
1414
class UploadTests: XCTestCase {
1515
private let largeFileSize: Int = 6_034_668
1616
private let sampleFileSize: Int = 200_367
17-
private let sampleFileURL = Helpers.url(forResource: "sample", withExtension: "jpg")!
18-
private let largeFileURL = Helpers.url(forResource: "large", withExtension: "jpg")!
17+
private let sampleFileURL = Helpers.url(forResource: "sample", withExtension: "jpg", subdirectory: "Fixtures")!
18+
private let largeFileURL = Helpers.url(forResource: "large", withExtension: "jpg", subdirectory: "Fixtures")!
1919

2020
private let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
2121
private let chunkSize = 1 * Int(pow(Double(1024), Double(2)))

Tests/FilestackSDKTests/UploadableTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class UploadableTests: XCTestCase {
1212
// MARK: - URL Tests
1313

1414
func testExistingLocalURLSize() {
15-
let localURL = Helpers.url(forResource: "sample", withExtension: "jpg")!
15+
let localURL = Helpers.url(forResource: "sample", withExtension: "jpg", subdirectory: "Fixtures")!
1616

1717
XCTAssertEqual(localURL.size, 200_367)
1818
}

0 commit comments

Comments
 (0)