Просмотр исходного кода

Merge branch 'master' into 5.0

# Conflicts:
#	Sources/Image.swift
onevcat 7 лет назад
Родитель
Сommit
53e4b47109
2 измененных файлов с 10 добавлено и 2 удалено
  1. 1 1
      Package.swift
  2. 9 1
      Tests/KingfisherTests/ImageExtensionTests.swift

+ 1 - 1
Package.swift

@@ -28,5 +28,5 @@ import PackageDescription
 
 
 let package = Package(
 let package = Package(
   name: "Kingfisher",
   name: "Kingfisher",
-  exclude: ["Tests","Sources/AnimatedImageView.swift","Sources/UIButton+Kingfisher.swift"]
+  exclude: ["Tests", "Sources/AnimatedImageView.swift", "Sources/UIButton+Kingfisher.swift", "Sources/WKInterfaceImage+Kingfisher.swift"]
 )
 )

+ 9 - 1
Tests/KingfisherTests/ImageExtensionTests.swift

@@ -69,7 +69,15 @@ class ImageExtensionTests: XCTestCase {
         XCTAssertEqual(image!.kf.duration, 0.8, accuracy: 0.001, "The image duration should be 0.8s")
         XCTAssertEqual(image!.kf.duration, 0.8, accuracy: 0.001, "The image duration should be 0.8s")
 #endif
 #endif
     }
     }
-    
+
+#if os(iOS) || os(tvOS)
+    func testScaleForGIFImage() {
+        let image = Kingfisher<Image>.animated(with: testImageGIFData, scale: 2.0, duration: 0.0, preloadAll: false, onlyFirstFrame: false)
+        XCTAssertNotNil(image, "The image should be initiated.")
+        XCTAssertEqual(image!.scale, 2.0, "should have correct scale")
+    }
+#endif
+
     func testGIFRepresentation() {
     func testGIFRepresentation() {
         let options = ImageCreatingOptions()
         let options = ImageCreatingOptions()
         let image = KingfisherClass<Image>.animatedImage(data: testImageGIFData, options: options)!
         let image = KingfisherClass<Image>.animatedImage(data: testImageGIFData, options: options)!