diff --git a/Zip.xcodeproj/project.pbxproj b/Zip.xcodeproj/project.pbxproj index 05b360c360e8c6843709520e7c69d2522c195843..9bd4a3a7b689fbe4c12d9abcb0e9d9978a865505 100644 --- a/Zip.xcodeproj/project.pbxproj +++ b/Zip.xcodeproj/project.pbxproj @@ -79,8 +79,6 @@ 347E3AD81C1E04C900A11FD3 /* Zip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347E3AD71C1E04C900A11FD3 /* Zip.swift */; }; 34940A241C58876200D41574 /* 3crBXeO.gif in Resources */ = {isa = PBXBuildFile; fileRef = 34940A221C58876200D41574 /* 3crBXeO.gif */; }; 34940A251C58876200D41574 /* kYkLkPf.gif in Resources */ = {isa = PBXBuildFile; fileRef = 34940A231C58876200D41574 /* kYkLkPf.gif */; }; - BBF824D51CA60383008FF3C5 /* bb8.cbz in Resources */ = {isa = PBXBuildFile; fileRef = BBF824D31CA60383008FF3C5 /* bb8.cbz */; }; - BBF824D61CA60383008FF3C5 /* bb8.xyz in Resources */ = {isa = PBXBuildFile; fileRef = BBF824D41CA60383008FF3C5 /* bb8.xyz */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -145,8 +143,6 @@ 347E3AD71C1E04C900A11FD3 /* Zip.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Zip.swift; sourceTree = ""; }; 34940A221C58876200D41574 /* 3crBXeO.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; name = 3crBXeO.gif; path = Images/3crBXeO.gif; sourceTree = ""; }; 34940A231C58876200D41574 /* kYkLkPf.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; name = kYkLkPf.gif; path = Images/kYkLkPf.gif; sourceTree = ""; }; - BBF824D31CA60383008FF3C5 /* bb8.cbz */ = {isa = PBXFileReference; lastKnownFileType = file; path = bb8.cbz; sourceTree = ""; }; - BBF824D41CA60383008FF3C5 /* bb8.xyz */ = {isa = PBXFileReference; lastKnownFileType = file; path = bb8.xyz; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -266,8 +262,6 @@ 347E3A821C1DFFB500A11FD3 /* ZipTests */ = { isa = PBXGroup; children = ( - BBF824D31CA60383008FF3C5 /* bb8.cbz */, - BBF824D41CA60383008FF3C5 /* bb8.xyz */, 34940A221C58876200D41574 /* 3crBXeO.gif */, 34940A231C58876200D41574 /* kYkLkPf.gif */, 3443A3FC1C4AD199004AD173 /* bb8.zip */, @@ -473,11 +467,9 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - BBF824D51CA60383008FF3C5 /* bb8.cbz in Resources */, 34940A251C58876200D41574 /* kYkLkPf.gif in Resources */, 3443A3FD1C4AD199004AD173 /* bb8.zip in Resources */, 34940A241C58876200D41574 /* 3crBXeO.gif in Resources */, - BBF824D61CA60383008FF3C5 /* bb8.xyz in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Zip/Zip.swift b/Zip/Zip.swift index 083e0a3f8c283c341e2f5b5b0e0067717598b6ad..4eb9e4bdde9ceab5db4a52ec11f41b67aaeea208 100644 --- a/Zip/Zip.swift +++ b/Zip/Zip.swift @@ -292,6 +292,6 @@ public class Zip { guard let fileExtension = fileExtension else { return true } - return ["zip", "cbz"].contains(fileExtension) + return !["zip", "cbz"].contains(fileExtension) } } \ No newline at end of file diff --git a/ZipTests/ZipTests.swift b/ZipTests/ZipTests.swift index d839220427bc9d05afb070204954452ec8675203..b420919d894c127962e7eaee33393edb033613c7 100644 --- a/ZipTests/ZipTests.swift +++ b/ZipTests/ZipTests.swift @@ -166,14 +166,14 @@ class ZipTests: XCTestCase { } func testFileExtensionIsInvalidForValidUrl() { - let fileUrl = NSBundle(forClass: ZipTests.self).URLForResource("bb8", withExtension: "cbz") + let fileUrl = NSURL(string: "file.cbz") let result = Zip.fileExtensionIsInvalid(fileUrl?.pathExtension) - XCTAssertTrue(result) + XCTAssertFalse(result) } func testFileExtensionIsInvalidForInvalidUrl() { - let fileUrl = NSBundle(forClass: ZipTests.self).URLForResource("bb8", withExtension: "xyz") + let fileUrl = NSURL(string: "file.xyz") let result = Zip.fileExtensionIsInvalid(fileUrl?.pathExtension) - XCTAssertFalse(result) + XCTAssertTrue(result) } } diff --git a/ZipTests/bb8.cbz b/ZipTests/bb8.cbz deleted file mode 100644 index 514266d193061fd851c447a37de608daef3136fa..0000000000000000000000000000000000000000 Binary files a/ZipTests/bb8.cbz and /dev/null differ diff --git a/ZipTests/bb8.xyz b/ZipTests/bb8.xyz deleted file mode 100644 index 514266d193061fd851c447a37de608daef3136fa..0000000000000000000000000000000000000000 Binary files a/ZipTests/bb8.xyz and /dev/null differ