diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f793cac..313b3db 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -15,7 +15,8 @@ jobs: - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.5 + ruby-version: 3.1.4 + bundler-cache: true - name: Bundle install run: bundle install diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8978baf..3139421 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.5 + ruby-version: 3.1.4 bundler-cache: true - name: Pods cache diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml index 15b20ce..96812af 100644 --- a/.github/workflows/prepare_release.yml +++ b/.github/workflows/prepare_release.yml @@ -14,7 +14,8 @@ jobs: - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.5 + ruby-version: 3.1.4 + bundler-cache: true - name: Bundle install run: bundle install diff --git a/ADUtils.podspec b/ADUtils.podspec index a5a66c3..0a32f2f 100644 --- a/ADUtils.podspec +++ b/ADUtils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'ADUtils' - spec.version = '11.3.0' + spec.version = '11.4.0' spec.authors = 'Fabernovel' spec.homepage = 'https://github.com/faberNovel/ADUtils' spec.summary = 'Fabernovel\'s toolbox for iOS' diff --git a/ADUtils.xcodeproj/project.pbxproj b/ADUtils.xcodeproj/project.pbxproj index c83254d..56da6fd 100644 --- a/ADUtils.xcodeproj/project.pbxproj +++ b/ADUtils.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -51,6 +51,7 @@ 921907DF21F7AE4400EF2B67 /* ADLayoutGuideTestsObjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 921907DE21F7AE4400EF2B67 /* ADLayoutGuideTestsObjc.m */; }; 92DA1F5F2257556800060A32 /* NSLayoutConstraintUtilsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92DA1F5E2257556800060A32 /* NSLayoutConstraintUtilsTests.swift */; }; 92FAEA942271DF0D0090A2C7 /* FailableDecodableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92FAEA932271DF0D0090A2C7 /* FailableDecodableTests.swift */; }; + ACD166862A45C0A700374A7E /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = ACD166852A45C0A700374A7E /* SnapshotTesting */; }; B0E1495F269444E600712620 /* SecureArchiverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0E1495E269444E600712620 /* SecureArchiverTests.swift */; }; E7D5F497242DED3C0048C0DC /* OptionalGetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7D5F496242DED3C0048C0DC /* OptionalGetTests.swift */; }; E7D5F499242DEF120048C0DC /* UINavigationItemBackItemTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7D5F498242DEF120048C0DC /* UINavigationItemBackItemTests.swift */; }; @@ -173,6 +174,7 @@ buildActionMask = 2147483647; files = ( 47E17214F9A4009CF12359D7 /* Pods_ADUtilsTests.framework in Frameworks */, + ACD166862A45C0A700374A7E /* SnapshotTesting in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -414,6 +416,9 @@ 49B1F7841CE4B3DB00A29BFE /* PBXTargetDependency */, ); name = ADUtilsTests; + packageProductDependencies = ( + ACD166852A45C0A700374A7E /* SnapshotTesting */, + ); productName = ADUtilsTests; productReference = 49B1F77E1CE4B3DB00A29BFE /* ADUtilsTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -473,6 +478,9 @@ en, ); mainGroup = 7A0EC6441535D8ED00E5F54A; + packageReferences = ( + ACD166842A45C0A700374A7E /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */, + ); productRefGroup = 7A0EC6501535D8ED00E5F54A /* Products */; projectDirPath = ""; projectRoot = ""; @@ -580,19 +588,15 @@ "${PODS_ROOT}/Target Support Files/Pods-ADUtilsTests/Pods-ADUtilsTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/ADUtils/ADUtils.framework", "${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework", - "${BUILT_PRODUCTS_DIR}/Nimble-Snapshots/Nimble_Snapshots.framework", "${BUILT_PRODUCTS_DIR}/OCMock/OCMock.framework", "${BUILT_PRODUCTS_DIR}/Quick/Quick.framework", - "${BUILT_PRODUCTS_DIR}/iOSSnapshotTestCase/FBSnapshotTestCase.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ADUtils.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble_Snapshots.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OCMock.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSnapshotTestCase.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -743,7 +747,11 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = ADUtilsTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = applidium.ADUtilsTests; @@ -774,7 +782,11 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = ADUtilsTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = applidium.ADUtilsTests; @@ -805,7 +817,11 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = ADUtilsTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = applidium.ADUtilsTests; @@ -836,7 +852,11 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INFOPLIST_FILE = ADUtilsTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = applidium.ADUtilsTests; @@ -891,7 +911,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; PROVISIONING_PROFILE_SPECIFIER = "$(PROFILE_UDID)"; SDKROOT = iphoneos; SWIFT_VERSION = 5.0; @@ -912,7 +932,10 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADUtils-Prefix.pch"; INFOPLIST_FILE = "Configuration/ADUtils/ADUtils-Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.applidium.ADUtils; PRODUCT_MODULE_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -963,7 +986,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; PROVISIONING_PROFILE_SPECIFIER = "$(PROFILE_UDID)"; SDKROOT = iphoneos; @@ -986,7 +1009,10 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADUtils-Prefix.pch"; INFOPLIST_FILE = "Configuration/ADUtils/ADUtils-Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.applidium.ADUtils; PRODUCT_MODULE_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1039,7 +1065,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; PROVISIONING_PROFILE_SPECIFIER = "$(PROFILE_UDID)"; SDKROOT = iphoneos; SWIFT_VERSION = 5.0; @@ -1060,7 +1086,10 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADUtils-Prefix.pch"; INFOPLIST_FILE = "Configuration/ADUtils/ADUtils-Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.applidium.ADUtils; PRODUCT_MODULE_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1114,7 +1143,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; PROVISIONING_PROFILE_SPECIFIER = "$(PROFILE_UDID)"; SDKROOT = iphoneos; SWIFT_VERSION = 5.0; @@ -1135,7 +1164,10 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADUtils-Prefix.pch"; INFOPLIST_FILE = "Configuration/ADUtils/ADUtils-Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.applidium.ADUtils; PRODUCT_MODULE_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1183,6 +1215,25 @@ defaultConfigurationName = Distribution; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + ACD166842A45C0A700374A7E /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/pointfreeco/swift-snapshot-testing.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.0.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + ACD166852A45C0A700374A7E /* SnapshotTesting */ = { + isa = XCSwiftPackageProductDependency; + package = ACD166842A45C0A700374A7E /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */; + productName = SnapshotTesting; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 7A0EC6461535D8ED00E5F54A /* Project object */; } diff --git a/ADUtils.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ADUtils.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..0e946a1 --- /dev/null +++ b/ADUtils.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "swift-snapshot-testing", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-snapshot-testing.git", + "state" : { + "revision" : "cef5b3f6f11781dd4591bdd1dd0a3d22bd609334", + "version" : "1.11.0" + } + } + ], + "version" : 2 +} diff --git a/ADUtilsTests/ArrayFilterTests.swift b/ADUtilsTests/ArrayFilterTests.swift index 7b8a753..3e58143 100644 --- a/ADUtilsTests/ArrayFilterTests.swift +++ b/ADUtilsTests/ArrayFilterTests.swift @@ -17,7 +17,7 @@ private struct Vendor { class ArrayFilterTests: QuickSpec { - override func spec() { + override class func spec() { it("should filter the array") { let vendors = [ diff --git a/ADUtilsTests/AttributedStringTest.swift b/ADUtilsTests/AttributedStringTest.swift index a39bd03..cca0a90 100644 --- a/ADUtilsTests/AttributedStringTest.swift +++ b/ADUtilsTests/AttributedStringTest.swift @@ -8,14 +8,14 @@ import Foundation import Nimble -import Nimble_Snapshots +import SnapshotTesting import Quick import ADUtils @testable import ADUtilsApp class AttributedStringTest: QuickSpec { - override func spec() { + override class func spec() { let stringTest = { (string: String, arguments: [String], imageName: String) -> Void in guard @@ -50,7 +50,7 @@ class AttributedStringTest: QuickSpec { let label = UILabel() label.attributedText = attributedString label.sizeToFit() - expect(label).to(haveValidSnapshot(named: imageName)) + assertSnapshot(matching: label, as: .image, named: imageName) } it("Snapshots should match") { diff --git a/ADUtilsTests/ChildInsertionTest.swift b/ADUtilsTests/ChildInsertionTest.swift index ae2782f..e0e5771 100644 --- a/ADUtilsTests/ChildInsertionTest.swift +++ b/ADUtilsTests/ChildInsertionTest.swift @@ -14,7 +14,7 @@ import ADUtils class ChildInsertionTest: QuickSpec { - override func spec() { + override class func spec() { it("should insert a view controller in a subview") { let viewController = UIViewController() let child = UIViewController() diff --git a/ADUtilsTests/DebouncedTests.swift b/ADUtilsTests/DebouncedTests.swift index 8612ad7..3b16497 100644 --- a/ADUtilsTests/DebouncedTests.swift +++ b/ADUtilsTests/DebouncedTests.swift @@ -18,7 +18,7 @@ private enum Constants { /// Test for regular Debouncer class class DebouncerTests: QuickSpec { - override func spec() { + override class func spec() { var debouncer: Debouncer? var counter: Int = 0 @@ -85,10 +85,10 @@ class DebouncerTests: QuickSpec { class DebouncedTests: QuickSpec { @Debounced(delay: Constants.delay, queue: .main) - private var toggleAction: () -> Void - private var actionExecuted: Bool = false + private static var toggleAction: () -> Void + private static var actionExecuted: Bool = false - override func spec() { + override class func spec() { beforeEach { self.actionExecuted = false diff --git a/ADUtilsTests/DeselectableViewTests.swift b/ADUtilsTests/DeselectableViewTests.swift index 986e922..51a325a 100644 --- a/ADUtilsTests/DeselectableViewTests.swift +++ b/ADUtilsTests/DeselectableViewTests.swift @@ -67,7 +67,7 @@ private class TransitionCoordinator: NSObject, UIViewControllerTransitionCoordin class DeselectableViewTests: QuickSpec { - override func spec() { + override class func spec() { let selectedIndexPath = IndexPath(row: 0, section: 0) var transitionCoordinator: TransitionCoordinator! diff --git a/ADUtilsTests/DynamicFontTest.swift b/ADUtilsTests/DynamicFontTest.swift index 4fd83a1..df61bf4 100644 --- a/ADUtilsTests/DynamicFontTest.swift +++ b/ADUtilsTests/DynamicFontTest.swift @@ -5,11 +5,12 @@ // Created by Benjamin Lavialle on 25/10/2017. // -import Foundation +import UIKit +import SwiftUI import Quick import ADUtils import Nimble -import Nimble_Snapshots +import SnapshotTesting private extension UIFont { @@ -18,6 +19,13 @@ private extension UIFont { } } +private extension Font { + + static func ad_mainFont(forTextStyle textStyle: Font.TextStyle) -> Font { + return FontHelper.shared.helveticaNeueDynamicFont.font(forTextStyle: textStyle) + } +} + private class FontHelper { static let shared = FontHelper() @@ -34,9 +42,9 @@ private class FontHelper { class DynamicFontTest: QuickSpec { - override func spec() { + override class func spec() { - describe("display fonts") { + describe("display UIKit fonts") { let types: [UIFont.TextStyle] = [ .title1, @@ -68,7 +76,60 @@ class DynamicFontTest: QuickSpec { it("should layout labels properly") { stackView.layoutIfNeeded() - expect(stackView).to(haveValidSnapshot(named: "DynamicFontLayoutTest")) + assertSnapshot(matching: stackView, as: .image, named: "DynamicFontLayoutTest") + assertSnapshot( + matching: stackView, + as: .image(traits: UITraitCollection(preferredContentSizeCategory: .extraExtraExtraLarge)), + named: "DynamicFontLayoutXXLTest" + ) + } + } + + describe("display SwiftUI fonts") { + + @available(iOS 14.0, *) + struct DynamicFontsView: View { + + let types: [Font.TextStyle] = [ + .title, + .title2, + .title3, + .headline, + .subheadline, + .body, + .callout, + .footnote, + .caption, + .caption2 + ] + + var body: some View { + VStack(alignment: .leading, spacing: 8) { + ForEach(types.indices, id: \.self) { index in + Text("Lorem sizzle pimpin' sit amizzle").font(.ad_mainFont(forTextStyle: types[index])) + } + } + } + } + it("should layout labels properly") { + if #available(iOS 14.0, *) { + let view = DynamicFontsView() + assertSnapshot( + matching: view, + as: .image(layout: .fixed(width: 200, height: 1000)), + named: "SwiftUIDynamicFontLayoutTest" + ) + assertSnapshot( + matching: view, + as: .image( + layout: .fixed(width: 200, height: 1000), + traits: UITraitCollection(preferredContentSizeCategory: .extraExtraExtraLarge) + ), + named: "SwiftUIDynamicFontLayoutXXLTest" + ) + } else { + throw XCTSkip("title2, title3, caption2 are only available on iOS 14") + } } } } diff --git a/ADUtilsTests/FailableDecodableTests.swift b/ADUtilsTests/FailableDecodableTests.swift index 8231cae..da9058f 100644 --- a/ADUtilsTests/FailableDecodableTests.swift +++ b/ADUtilsTests/FailableDecodableTests.swift @@ -47,7 +47,7 @@ private struct StrictFolder: Codable { class KeyedDecodingContainerTests: QuickSpec { - override func spec() { + override class func spec() { // Slack, Candidates and My-CV are valids, other are invalids let desktopJSON = """ { diff --git a/ADUtilsTests/GeometryUtilitiesTest.swift b/ADUtilsTests/GeometryUtilitiesTest.swift index b7e510b..12f0c45 100644 --- a/ADUtilsTests/GeometryUtilitiesTest.swift +++ b/ADUtilsTests/GeometryUtilitiesTest.swift @@ -11,7 +11,7 @@ import Nimble import ADUtils class GeometryUtilitiesTest : QuickSpec { - override func spec() { + override class func spec() { it("should update the origin of rectangle") { var rect = CGRect(x: 20, y: 20, width: 40, height: 60) rect.center = CGPoint(x: 0, y: 0) diff --git a/ADUtilsTests/LayoutGuideConstraintsTests.swift b/ADUtilsTests/LayoutGuideConstraintsTests.swift index ccfd6fe..e0f4f80 100644 --- a/ADUtilsTests/LayoutGuideConstraintsTests.swift +++ b/ADUtilsTests/LayoutGuideConstraintsTests.swift @@ -7,13 +7,13 @@ import Foundation import Nimble -import Nimble_Snapshots +import SnapshotTesting import Quick import ADUtils class LayoutGuideConstraintsTests: QuickSpec { - override func spec() { + override class func spec() { standardEdgesSpec() if #available(iOS 13, *) { directionalEdgesSpec() @@ -22,7 +22,7 @@ class LayoutGuideConstraintsTests: QuickSpec { // MARK: - Private - private func standardEdgesSpec() { + private static func standardEdgesSpec() { describe("Pin to layout guide using UIRectEdge and UIEdgeInsets") { let insets = UIEdgeInsets(top: 12.0, left: 13.0, bottom: 20.0, right: 45.0) @@ -40,28 +40,28 @@ class LayoutGuideConstraintsTests: QuickSpec { it("should pin all edges no insets") { subview.ad_pin(to: view.layoutMarginsGuide) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesNoInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesNoInsets") } it("should pin all edges with insets") { subview.ad_pin(to: view.layoutMarginsGuide, insets: insets) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesWithInsets") } it("should pin top left edges no insets") { subview.ad_pin(to: view.layoutMarginsGuide, edges: [.top, .left]) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesNoInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesNoInsets") } it("should pin top left edges with insets") { subview.ad_pin(to: view.layoutMarginsGuide, edges: [.top, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesWithInsets") } it("should have no effet with wrong layout guide") { let extraView = UIView() subview.ad_pin(to: extraView.layoutMarginsGuide) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideNoSubview")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideNoSubview") } it("should pin top left with high priorities") { @@ -79,7 +79,7 @@ class LayoutGuideConstraintsTests: QuickSpec { insets: insets, priority: .defaultHigh ) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesHighPriority")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesHighPriority") } } @@ -100,19 +100,19 @@ class LayoutGuideConstraintsTests: QuickSpec { subview.ad_center(in: view.layoutMarginsGuide) // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here subview.ad_constrain(to: subview.intrinsicContentSize) - expect(view).to(haveValidSnapshot(named: "CenterInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterInLayoutGuide") } it("should center X in layout guide") { subview.ad_pin(to: view.layoutMarginsGuide, edges: [.top, .bottom]) subview.ad_center(in: view.layoutMarginsGuide, along: .horizontal) - expect(view).to(haveValidSnapshot(named: "CenterXInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterXInLayoutGuide") } it("should center Y in layout guide") { subview.ad_pin(to: view.layoutMarginsGuide, edges: [.left, .right]) subview.ad_center(in: view.layoutMarginsGuide, along: .vertical) - expect(view).to(haveValidSnapshot(named: "CenterYInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterYInLayoutGuide") } } @@ -133,31 +133,31 @@ class LayoutGuideConstraintsTests: QuickSpec { it("should constrain in layout guide pin bottom left") { subview.ad_pin(to: view.layoutMarginsGuide, edges: [.bottom, .left], insets: insets) subview.ad_constrain(in: view.layoutMarginsGuide, edges: [.top, .right], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomLeft") } it("should constrain in layout guide pin bottom right") { subview.ad_pin(to: view.layoutMarginsGuide, edges: [.bottom, .right], insets: insets) subview.ad_constrain(in: view.layoutMarginsGuide, edges: [.top, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomRight") } it("should constrain in layout guide top left") { subview.ad_pin(to: view.layoutMarginsGuide, edges: [.top, .left], insets: insets) subview.ad_constrain(in: view.layoutMarginsGuide, edges: [.bottom, .right], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopLeft") } it("should constrain in layout guide pin top right") { subview.ad_pin(to: view.layoutMarginsGuide, edges: [.top, .right], insets: insets) subview.ad_constrain(in: view.layoutMarginsGuide, edges: [.bottom, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopRight") } it("should constrain in layout guide") { subview.ad_center(in: view.layoutMarginsGuide) subview.ad_constrain(in: view.layoutMarginsGuide) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuide") } it("should constrain in layout guide with insets") { @@ -165,7 +165,7 @@ class LayoutGuideConstraintsTests: QuickSpec { // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here subview.ad_constrain(to: subview.intrinsicContentSize, priority: .defaultLow) subview.ad_constrain(in: view.layoutMarginsGuide, insets: UIEdgeInsets(value: 10.0)) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithInsets")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithInsets") } it("should constrain in layout guide with left edge") { @@ -173,7 +173,7 @@ class LayoutGuideConstraintsTests: QuickSpec { // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here subview.ad_constrain(to: subview.intrinsicContentSize, priority: .defaultLow) subview.ad_constrain(in: view.layoutMarginsGuide, edges: [.left]) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithLeftEdge")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithLeftEdge") } } @@ -197,31 +197,31 @@ class LayoutGuideConstraintsTests: QuickSpec { it("should pin all edges no insets") { subview.ad_pin(to: layoutGuide) layoutGuide.ad_pin(to: view.layoutMarginsGuide) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesNoInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesNoInsets") } it("should pin all edges with insets") { subview.ad_pin(to: layoutGuide) layoutGuide.ad_pin(to: view.layoutMarginsGuide, insets: insets) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesWithInsets") } it("should pin top left edges no insets") { subview.ad_pin(to: layoutGuide) layoutGuide.ad_pin(to: view.layoutMarginsGuide, edges: [.top, .left]) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesNoInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesNoInsets") } it("should pin top left edges with insets") { subview.ad_pin(to: layoutGuide) layoutGuide.ad_pin(to: view.layoutMarginsGuide, edges: [.top, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesWithInsets") } it("should have no effet with wrong layout guide") { let extraView = UIView() layoutGuide.ad_pin(to: extraView.layoutMarginsGuide) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideNoSubview")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideNoSubview") } it("should pin top left with high priorities") { @@ -240,7 +240,7 @@ class LayoutGuideConstraintsTests: QuickSpec { insets: insets, priority: .defaultHigh ) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesHighPriority")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesHighPriority") } } @@ -264,19 +264,19 @@ class LayoutGuideConstraintsTests: QuickSpec { layoutGuide.ad_center(in: view.layoutMarginsGuide) // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here layoutGuide.ad_constrain(to: subview.intrinsicContentSize) - expect(view).to(haveValidSnapshot(named: "CenterInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterInLayoutGuide") } it("should center X in layout guide") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, edges: [.top, .bottom]) layoutGuide.ad_center(in: view.layoutMarginsGuide, along: .horizontal) - expect(view).to(haveValidSnapshot(named: "CenterXInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterXInLayoutGuide") } it("should center Y in layout guide") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, edges: [.left, .right]) layoutGuide.ad_center(in: view.layoutMarginsGuide, along: .vertical) - expect(view).to(haveValidSnapshot(named: "CenterYInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterYInLayoutGuide") } } @@ -300,31 +300,31 @@ class LayoutGuideConstraintsTests: QuickSpec { it("should constrain in layout guide pin bottom left") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, edges: [.bottom, .left], insets: insets) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, edges: [.top, .right], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomLeft") } it("should constrain in layout guide pin bottom right") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, edges: [.bottom, .right], insets: insets) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, edges: [.top, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomRight") } it("should constrain in layout guide top left") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, edges: [.top, .left], insets: insets) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, edges: [.bottom, .right], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopLeft") } it("should constrain in layout guide pin top right") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, edges: [.top, .right], insets: insets) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, edges: [.bottom, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopRight") } it("should constrain in layout guide") { layoutGuide.ad_center(in: view.layoutMarginsGuide) layoutGuide.ad_constrain(in: view.layoutMarginsGuide) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuide") } it("should constrain in layout guide with insets") { @@ -332,7 +332,7 @@ class LayoutGuideConstraintsTests: QuickSpec { // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here layoutGuide.ad_constrain(to: subview.intrinsicContentSize, priority: .defaultLow) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, insets: UIEdgeInsets(value: 10.0)) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithInsets")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithInsets") } it("should constrain in layout guide with left edge") { @@ -340,14 +340,14 @@ class LayoutGuideConstraintsTests: QuickSpec { // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here layoutGuide.ad_constrain(to: subview.intrinsicContentSize, priority: .defaultLow) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, edges: [.left]) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithLeftEdge")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithLeftEdge") } } } @available(iOS 13.0, *) @available(tvOSApplicationExtension 13.0, *) - private func directionalEdgesSpec() { + private static func directionalEdgesSpec() { describe("Pin to layout guide using NSDirectionalRectEdge and NSDirectionalRectEdge") { let insets = NSDirectionalEdgeInsets(top: 12.0, leading: 13.0, bottom: 20.0, trailing: 45.0) @@ -365,38 +365,38 @@ class LayoutGuideConstraintsTests: QuickSpec { it("should pin all edges no insets") { subview.ad_pin(to: view.layoutMarginsGuide, usingDirectionalEdges: true) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesNoInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesNoInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesNoInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesNoInsetsRTLForced") } it("should pin all edges with insets") { subview.ad_pin(to: view.layoutMarginsGuide, insets: insets) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesWithInsetsRTLForced") } it("should pin top left edges no insets") { subview.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.top, .leading]) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesNoInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesNoInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesNoInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesNoInsetsRTLForced") } it("should pin top left edges with insets") { subview.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.top, .leading], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesWithInsetsRTLForced") } it("should have no effet with wrong layout guide") { let extraView = UIView() subview.ad_pin(to: extraView.layoutMarginsGuide, usingDirectionalEdges: true) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideNoSubview")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideNoSubview") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideNoSubviewRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideNoSubviewRTLForced") } it("should pin top left with high priorities") { @@ -414,9 +414,9 @@ class LayoutGuideConstraintsTests: QuickSpec { insets: insets, priority: .defaultHigh ) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesHighPriority")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesHighPriority") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesHighPriorityRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesHighPriorityRTLForced") } } @@ -437,25 +437,25 @@ class LayoutGuideConstraintsTests: QuickSpec { subview.ad_center(in: view.layoutMarginsGuide) // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here subview.ad_constrain(to: subview.intrinsicContentSize) - expect(view).to(haveValidSnapshot(named: "CenterInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterInLayoutGuide") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "CenterInLayoutGuideRTLForced")) + assertSnapshot(matching: view, as: .image, named: "CenterInLayoutGuideRTLForced") } it("should center X in layout guide") { subview.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.top, .bottom]) subview.ad_center(in: view.layoutMarginsGuide, along: .horizontal) - expect(view).to(haveValidSnapshot(named: "CenterXInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterXInLayoutGuide") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "CenterXInLayoutGuideRTLForced")) + assertSnapshot(matching: view, as: .image, named: "CenterXInLayoutGuideRTLForced") } it("should center Y in layout guide") { subview.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.leading, .trailing]) subview.ad_center(in: view.layoutMarginsGuide, along: .vertical) - expect(view).to(haveValidSnapshot(named: "CenterYInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterYInLayoutGuide") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "CenterYInLayoutGuideRTLForced")) + assertSnapshot(matching: view, as: .image, named: "CenterYInLayoutGuideRTLForced") } } @@ -476,41 +476,41 @@ class LayoutGuideConstraintsTests: QuickSpec { it("should constrain in layout guide pin bottom left") { subview.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.bottom, .leading], insets: insets) subview.ad_constrain(in: view.layoutMarginsGuide, directionalEdges: [.top, .trailing], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomLeft") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomLeftRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomLeftRTLForced") } it("should constrain in layout guide pin bottom right") { subview.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.bottom, .trailing], insets: insets) subview.ad_constrain(in: view.layoutMarginsGuide, directionalEdges: [.top, .leading], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomRight") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomRightRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomRightRTLForced") } it("should constrain in layout guide top left") { subview.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.top, .leading], insets: insets) subview.ad_constrain(in: view.layoutMarginsGuide, directionalEdges: [.bottom, .trailing], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopLeft") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopLeftRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopLeftRTLForced") } it("should constrain in layout guide pin top right") { subview.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.top, .trailing], insets: insets) subview.ad_constrain(in: view.layoutMarginsGuide, directionalEdges: [.bottom, .leading], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopRight") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopRightRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopRightRTLForced") } it("should constrain in layout guide") { subview.ad_center(in: view.layoutMarginsGuide) subview.ad_constrain(in: view.layoutMarginsGuide) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuide") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideRTLForced") } it("should constrain in layout guide with insets") { @@ -518,9 +518,9 @@ class LayoutGuideConstraintsTests: QuickSpec { // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here subview.ad_constrain(to: subview.intrinsicContentSize, priority: .defaultLow) subview.ad_constrain(in: view.layoutMarginsGuide, insets: NSDirectionalEdgeInsets(value: 10.0)) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithInsets")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithInsetsRTLForced") } it("should constrain in layout guide with left edge") { @@ -528,9 +528,9 @@ class LayoutGuideConstraintsTests: QuickSpec { // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here subview.ad_constrain(to: subview.intrinsicContentSize, priority: .defaultLow) subview.ad_constrain(in: view.layoutMarginsGuide, directionalEdges: [.leading]) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithLeftEdge")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithLeftEdge") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithLeftEdgeRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithLeftEdgeRTLForced") } } @@ -554,41 +554,41 @@ class LayoutGuideConstraintsTests: QuickSpec { it("should pin all edges no insets") { subview.ad_pin(to: layoutGuide, usingDirectionalEdges: true) layoutGuide.ad_pin(to: view.layoutMarginsGuide) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesNoInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesNoInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesNoInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesNoInsetsRTLForced") } it("should pin all edges with insets") { subview.ad_pin(to: layoutGuide, usingDirectionalEdges: true) layoutGuide.ad_pin(to: view.layoutMarginsGuide, insets: insets) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideAllEdgesWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideAllEdgesWithInsetsRTLForced") } it("should pin top left edges no insets") { subview.ad_pin(to: layoutGuide, usingDirectionalEdges: true) layoutGuide.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.top, .leading]) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesNoInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesNoInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesNoInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesNoInsetsRTLForced") } it("should pin top left edges with insets") { subview.ad_pin(to: layoutGuide, usingDirectionalEdges: true) layoutGuide.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.top, .leading], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesWithInsetsRTLForced") } it("should have no effet with wrong layout guide") { let extraView = UIView() layoutGuide.ad_pin(to: extraView.layoutMarginsGuide, usingDirectionalEdges: true) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideNoSubview")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideNoSubview") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideNoSubviewRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideNoSubviewRTLForced") } it("should pin top left with high priorities") { @@ -607,9 +607,9 @@ class LayoutGuideConstraintsTests: QuickSpec { insets: insets, priority: .defaultHigh ) - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesHighPriority")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesHighPriority") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinToLayoutGuideTopLeftEdgesHighPriorityRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinToLayoutGuideTopLeftEdgesHighPriorityRTLForced") } } @@ -633,25 +633,25 @@ class LayoutGuideConstraintsTests: QuickSpec { layoutGuide.ad_center(in: view.layoutMarginsGuide) // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here layoutGuide.ad_constrain(to: subview.intrinsicContentSize) - expect(view).to(haveValidSnapshot(named: "CenterInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterInLayoutGuide") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "CenterInLayoutGuideRTLForced")) + assertSnapshot(matching: view, as: .image, named: "CenterInLayoutGuideRTLForced") } it("should center X in layout guide") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.top, .bottom]) layoutGuide.ad_center(in: view.layoutMarginsGuide, along: .horizontal) - expect(view).to(haveValidSnapshot(named: "CenterXInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterXInLayoutGuide") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "CenterXInLayoutGuideRTLForced")) + assertSnapshot(matching: view, as: .image, named: "CenterXInLayoutGuideRTLForced") } it("should center Y in layout guide") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.leading, .trailing]) layoutGuide.ad_center(in: view.layoutMarginsGuide, along: .vertical) - expect(view).to(haveValidSnapshot(named: "CenterYInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "CenterYInLayoutGuide") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "CenterYInLayoutGuideRTLForced")) + assertSnapshot(matching: view, as: .image, named: "CenterYInLayoutGuideRTLForced") } } @@ -675,41 +675,41 @@ class LayoutGuideConstraintsTests: QuickSpec { it("should constrain in layout guide pin bottom left") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.bottom, .leading], insets: insets) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, directionalEdges: [.top, .trailing], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomLeft") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomLeftRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomLeftRTLForced") } it("should constrain in layout guide pin bottom right") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.bottom, .trailing], insets: insets) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, directionalEdges: [.top, .leading], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomRight") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinBottomRightRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinBottomRightRTLForced") } it("should constrain in layout guide top left") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.top, .leading], insets: insets) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, directionalEdges: [.bottom, .trailing], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopLeft") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopLeftRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopLeftRTLForced") } it("should constrain in layout guide pin top right") { layoutGuide.ad_pin(to: view.layoutMarginsGuide, directionalEdges: [.top, .trailing], insets: insets) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, directionalEdges: [.bottom, .leading], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopRight") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuidePinTopRightRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuidePinTopRightRTLForced") } it("should constrain in layout guide") { layoutGuide.ad_center(in: view.layoutMarginsGuide) layoutGuide.ad_constrain(in: view.layoutMarginsGuide) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuide")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuide") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideRTLForced") } it("should constrain in layout guide with insets") { @@ -717,9 +717,9 @@ class LayoutGuideConstraintsTests: QuickSpec { // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here layoutGuide.ad_constrain(to: subview.intrinsicContentSize, priority: .defaultLow) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, insets: NSDirectionalEdgeInsets(value: 10.0)) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithInsets")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithInsetsRTLForced") } it("should constrain in layout guide with left edge") { @@ -727,9 +727,9 @@ class LayoutGuideConstraintsTests: QuickSpec { // ???: (Pierre Felgines) 08/10/2018 Intrinsic content size is not enough here layoutGuide.ad_constrain(to: subview.intrinsicContentSize, priority: .defaultLow) layoutGuide.ad_constrain(in: view.layoutMarginsGuide, directionalEdges: [.leading]) - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithLeftEdge")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithLeftEdge") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInLayoutGuideWithLeftEdgeRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInLayoutGuideWithLeftEdgeRTLForced") } } } diff --git a/ADUtilsTests/LayoutTests/ViewLayoutTest.swift b/ADUtilsTests/LayoutTests/ViewLayoutTest.swift index 2a2608f..c67f44d 100644 --- a/ADUtilsTests/LayoutTests/ViewLayoutTest.swift +++ b/ADUtilsTests/LayoutTests/ViewLayoutTest.swift @@ -14,7 +14,7 @@ import UIKit class ViewLayout: QuickSpec { - override func spec() { + override class func spec() { let veryLongText = "Lorem sizzle pimpin' sit amizzle, yippiyo adipiscing izzle. Nullizzle bling bling velit, away ghetto, suscipit dang, gravida vel, ass. Pellentesque eget tortor. Bow wow wow erizzle. Own yo' uhuh ... yih! sizzle dapibizzle turpis tempus shut the shizzle up. Maurizzle fo shizzle my nizzle crunk et turpizzle. Phat in tortizzle. Fizzle eleifend rhoncizzle i'm in the shizzle. In shut the shizzle up habitasse platea dictumst. Sheezy dapibizzle. Fo tellizzle urna, pretizzle eu, stuff shut the shizzle up, you son of a bizzle boofron, nunc. Fo suscipizzle. Integer sempizzle shizzle my nizzle crocodizzle ass purus" diff --git a/ADUtilsTests/LocaleUserPreferredTimeFormatTests.swift b/ADUtilsTests/LocaleUserPreferredTimeFormatTests.swift index 5d5d16b..ed92d8a 100644 --- a/ADUtilsTests/LocaleUserPreferredTimeFormatTests.swift +++ b/ADUtilsTests/LocaleUserPreferredTimeFormatTests.swift @@ -12,7 +12,7 @@ import ADUtils class LocaleUserPreferredTimeFormatTests: QuickSpec { - override func spec() { + override class func spec() { describe("When using an US region locale") { it("should return a 12 hours format for en_US locale") { let locale = Locale(identifier: "en_US") diff --git a/ADUtilsTests/MKMapViewDequeuingTest.swift b/ADUtilsTests/MKMapViewDequeuingTest.swift index 6515bac..5ffb096 100644 --- a/ADUtilsTests/MKMapViewDequeuingTest.swift +++ b/ADUtilsTests/MKMapViewDequeuingTest.swift @@ -23,7 +23,7 @@ class MapViewAnnotationView: MKAnnotationView { } class MKMapViewDequeuingTest: QuickSpec { - override func spec() { + override class func spec() { describe("Dequeuing") { var mapView = MKMapView() diff --git a/ADUtilsTests/NSDirectionalEdgeInsetsTests.swift b/ADUtilsTests/NSDirectionalEdgeInsetsTests.swift index 685fb76..3115432 100644 --- a/ADUtilsTests/NSDirectionalEdgeInsetsTests.swift +++ b/ADUtilsTests/NSDirectionalEdgeInsetsTests.swift @@ -14,7 +14,7 @@ import ADUtils @available(tvOSApplicationExtension 13.0, *) class NSDirectionalEdgeInsetsTests: QuickSpec { - override func spec() { + override class func spec() { it("should init directional insets with only one value") { let value: CGFloat = 10 let inset = NSDirectionalEdgeInsets(value: value) diff --git a/ADUtilsTests/NSLayoutConstraintUtilsTests.swift b/ADUtilsTests/NSLayoutConstraintUtilsTests.swift index 4537de6..7665a80 100644 --- a/ADUtilsTests/NSLayoutConstraintUtilsTests.swift +++ b/ADUtilsTests/NSLayoutConstraintUtilsTests.swift @@ -13,7 +13,7 @@ import UIKit class NSLayoutConstraintUtilsTests: QuickSpec { - override func spec() { + override class func spec() { it("should be higher than default priorities") { expect(UILayoutPriority.applyIfPossible.rawValue).to(beGreaterThan(UILayoutPriority.defaultLow.rawValue)) diff --git a/ADUtilsTests/NavigationControllerObserverTest.swift b/ADUtilsTests/NavigationControllerObserverTest.swift index d737d6b..266935c 100644 --- a/ADUtilsTests/NavigationControllerObserverTest.swift +++ b/ADUtilsTests/NavigationControllerObserverTest.swift @@ -41,7 +41,7 @@ private class NavigationControllerDelegate: NSObject, UINavigationControllerDele class NavigationControllerObserverTest : QuickSpec { - override func spec() { + override class func spec() { let rootViewController = UIViewController() let navigationController = UINavigationController(rootViewController: rootViewController) diff --git a/ADUtilsTests/NavigationControllerPopCompletionTests.swift b/ADUtilsTests/NavigationControllerPopCompletionTests.swift index 170e4bc..58947f1 100644 --- a/ADUtilsTests/NavigationControllerPopCompletionTests.swift +++ b/ADUtilsTests/NavigationControllerPopCompletionTests.swift @@ -41,7 +41,7 @@ class CompletionBehavior: Behavior { class NavigationControllerPopCompletionTests: QuickSpec { - override func spec() { + override class func spec() { let isAnimated = true let isNotAnimated = false itBehavesLike(CompletionBehavior.self) { isAnimated } diff --git a/ADUtilsTests/NibLoaderTest.swift b/ADUtilsTests/NibLoaderTest.swift index f622d44..0e23463 100644 --- a/ADUtilsTests/NibLoaderTest.swift +++ b/ADUtilsTests/NibLoaderTest.swift @@ -14,7 +14,7 @@ import ADUtils class NibLoaderTest: QuickSpec { - override func spec() { + override class func spec() { it("should return a view") { let testView = TestView.ad_fromNib() expect(testView).toNot(beNil()) diff --git a/ADUtilsTests/OptionalGetTests.swift b/ADUtilsTests/OptionalGetTests.swift index 7e4464b..ee793c5 100644 --- a/ADUtilsTests/OptionalGetTests.swift +++ b/ADUtilsTests/OptionalGetTests.swift @@ -12,7 +12,7 @@ import ADUtils class OptionalGetTests: QuickSpec { - override func spec() { + override class func spec() { it("should throw an error") { // Given diff --git a/ADUtilsTests/OptionalStringIsBlankTests.swift b/ADUtilsTests/OptionalStringIsBlankTests.swift index af34e5a..f7db7c8 100644 --- a/ADUtilsTests/OptionalStringIsBlankTests.swift +++ b/ADUtilsTests/OptionalStringIsBlankTests.swift @@ -12,7 +12,7 @@ import ADUtils class OptionalStringIsBlankTests: QuickSpec { - override func spec() { + override class func spec() { it("should be blank") { // Given diff --git a/ADUtilsTests/OptionalUnwrapTest.swift b/ADUtilsTests/OptionalUnwrapTest.swift index 04eed96..0bc931d 100644 --- a/ADUtilsTests/OptionalUnwrapTest.swift +++ b/ADUtilsTests/OptionalUnwrapTest.swift @@ -26,7 +26,7 @@ private func delay(_ duration: TimeInterval, block: @escaping () -> ()) { class OptionalUnwrap: QuickSpec { - override func spec() { + override class func spec() { describe("unwrap") { it("Should unwrap properly") { diff --git a/ADUtilsTests/OptionalVerifyOrNilTests.swift b/ADUtilsTests/OptionalVerifyOrNilTests.swift index 28f2c53..756c481 100644 --- a/ADUtilsTests/OptionalVerifyOrNilTests.swift +++ b/ADUtilsTests/OptionalVerifyOrNilTests.swift @@ -12,7 +12,7 @@ import ADUtils class OptionalVerifyOrNilTests: QuickSpec { - override func spec() { + override class func spec() { it("should return a valid object") { // Given diff --git a/ADUtilsTests/PropertyListArchiverTest.swift b/ADUtilsTests/PropertyListArchiverTest.swift index ed1cb57..a7091b3 100644 --- a/ADUtilsTests/PropertyListArchiverTest.swift +++ b/ADUtilsTests/PropertyListArchiverTest.swift @@ -53,7 +53,7 @@ extension User : PropertyListReadable { class PropertyListArchiverTest: QuickSpec { - override func spec() { + override class func spec() { var defaults: UserDefaults! var archiver: PropertyListArchiver! diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeArea@2x.png b/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeArea@2x.png deleted file mode 100644 index a95135e..0000000 Binary files a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeArea@2x.png and /dev/null differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinTopLeft@2x.png b/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinTopLeft@2x.png deleted file mode 100644 index 54e2650..0000000 Binary files a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinTopLeft@2x.png and /dev/null differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinTopRight@2x.png b/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinTopRight@2x.png deleted file mode 100644 index 54e2650..0000000 Binary files a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinTopRight@2x.png and /dev/null differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaWithLeftEdge@2x.png b/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaWithLeftEdge@2x.png deleted file mode 100644 index a95135e..0000000 Binary files a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaWithLeftEdge@2x.png and /dev/null differ diff --git a/ADUtilsTests/RegisterableViewTest.swift b/ADUtilsTests/RegisterableViewTest.swift index 1d8ad20..49d4c3c 100644 --- a/ADUtilsTests/RegisterableViewTest.swift +++ b/ADUtilsTests/RegisterableViewTest.swift @@ -99,7 +99,7 @@ private enum Constants { class RegisterableViewTest: QuickSpec { - override func spec() { + override class func spec() { describe("UITableView") { diff --git a/ADUtilsTests/Security/PostInstallationKeychainCleanerTests.swift b/ADUtilsTests/Security/PostInstallationKeychainCleanerTests.swift index a4e3d87..dc06029 100644 --- a/ADUtilsTests/Security/PostInstallationKeychainCleanerTests.swift +++ b/ADUtilsTests/Security/PostInstallationKeychainCleanerTests.swift @@ -21,7 +21,7 @@ private class KeychainWiperMock: KeychainWiper { class PostInstallationKeychainCleanerTests: QuickSpec { - override func spec() { + override class func spec() { var keychainWiper: KeychainWiperMock! var userDefaults: UserDefaults! diff --git a/ADUtilsTests/Security/SecureArchiverTests.swift b/ADUtilsTests/Security/SecureArchiverTests.swift index 7e0c336..2144822 100644 --- a/ADUtilsTests/Security/SecureArchiverTests.swift +++ b/ADUtilsTests/Security/SecureArchiverTests.swift @@ -63,7 +63,7 @@ private class KeychainArchiverImplementation: KeychainArchiver { @available(iOS 13.0, *) class SecureArchiverTests: QuickSpec { - override func spec() { + override class func spec() { var storageArchiver: StorageArchiverImplementation! var keychainArchiver: KeychainArchiverImplementation! diff --git a/ADUtilsTests/SequenceGroupedByTests.swift b/ADUtilsTests/SequenceGroupedByTests.swift index 677e3ae..7e269c4 100644 --- a/ADUtilsTests/SequenceGroupedByTests.swift +++ b/ADUtilsTests/SequenceGroupedByTests.swift @@ -17,7 +17,7 @@ private struct Person { class SequenceGroupedByTests: QuickSpec { - override func spec() { + override class func spec() { it("should group the sequence") { let persons = [ diff --git a/ADUtilsTests/StackViewBuilderTests.swift b/ADUtilsTests/StackViewBuilderTests.swift index ea911a3..296a4a1 100644 --- a/ADUtilsTests/StackViewBuilderTests.swift +++ b/ADUtilsTests/StackViewBuilderTests.swift @@ -9,7 +9,7 @@ import Foundation import Nimble import Quick import ADUtils -import Nimble_Snapshots +import SnapshotTesting private extension UIView { convenience init(color: UIColor) { @@ -20,7 +20,7 @@ private extension UIView { class StackViewBuilderTests: QuickSpec { - override func spec() { + override class func spec() { describe("HStackView") { @@ -41,7 +41,7 @@ class StackViewBuilderTests: QuickSpec { ) // Then - expect(stackView).to(haveValidSnapshot(named: "HStackViewDefault")) + assertSnapshot(matching: stackView, as: .image, named: "HStackViewDefault") } it("should have correct snapshot with custom parameters") { @@ -63,7 +63,7 @@ class StackViewBuilderTests: QuickSpec { ) // Then - expect(stackView).to(haveValidSnapshot(named: "HStackViewCustom")) + assertSnapshot(matching: stackView, as: .image, named: "HStackViewCustom") } } // HStackView @@ -87,7 +87,7 @@ class StackViewBuilderTests: QuickSpec { ) // Then - expect(stackView).to(haveValidSnapshot(named: "VStackViewDefault")) + assertSnapshot(matching: stackView, as: .image, named: "VStackViewDefault") } it("should have correct snapshot with custom parameters") { @@ -109,7 +109,7 @@ class StackViewBuilderTests: QuickSpec { ) // Then - expect(stackView).to(haveValidSnapshot(named: "VStackViewCustom")) + assertSnapshot(matching: stackView, as: .image, named: "VStackViewCustom") } } // VStackView diff --git a/ADUtilsTests/StackViewUtilsTests.swift b/ADUtilsTests/StackViewUtilsTests.swift index d67680b..33636e0 100644 --- a/ADUtilsTests/StackViewUtilsTests.swift +++ b/ADUtilsTests/StackViewUtilsTests.swift @@ -13,7 +13,7 @@ import UIKit class StackViewUtilsTests: QuickSpec { - override func spec() { + override class func spec() { var stackView: UIStackView! beforeEach { diff --git a/ADUtilsTests/StringLocalizationTests.swift b/ADUtilsTests/StringLocalizationTests.swift index a2e88c9..d737007 100644 --- a/ADUtilsTests/StringLocalizationTests.swift +++ b/ADUtilsTests/StringLocalizationTests.swift @@ -12,7 +12,7 @@ import ADUtils class StringLocalizationTests: QuickSpec { - override func spec() { + override class func spec() { it("should return the correct localized string") { // Given diff --git a/ADUtilsTests/SynchronizeTests.swift b/ADUtilsTests/SynchronizeTests.swift index d725f6c..3893924 100644 --- a/ADUtilsTests/SynchronizeTests.swift +++ b/ADUtilsTests/SynchronizeTests.swift @@ -12,7 +12,7 @@ import ADUtils class SynchronizeTests: QuickSpec { - override func spec() { + override class func spec() { // TODO: (Pierre Felgines) 01/10/2018 Find more useful test it("should execute block") { diff --git a/ADUtilsTests/UIButtonBackgroundColorTests.swift b/ADUtilsTests/UIButtonBackgroundColorTests.swift index 79a5149..e0e633b 100644 --- a/ADUtilsTests/UIButtonBackgroundColorTests.swift +++ b/ADUtilsTests/UIButtonBackgroundColorTests.swift @@ -9,11 +9,11 @@ import Foundation import Nimble import Quick import ADUtils -import Nimble_Snapshots +import SnapshotTesting class UIButtonBackgroundColorTests: QuickSpec { - override func spec() { + override class func spec() { it("should have correct snapshot") { // Given @@ -28,12 +28,12 @@ class UIButtonBackgroundColorTests: QuickSpec { button.ad_setBackgroundColor(.green, for: .disabled) // Then - expect(button).to(haveValidSnapshot(named: "UIButtonBackgroundColorNormal")) + assertSnapshot(matching: button, as: .image, named: "UIButtonBackgroundColorNormal") button.isEnabled = false - expect(button).to(haveValidSnapshot(named: "UIButtonBackgroundColorDisabled")) + assertSnapshot(matching: button, as: .image, named: "UIButtonBackgroundColorDisabled") button.ad_setBackgroundColor(nil, for: .disabled) - expect(button).to(haveValidSnapshot(named: "UIButtonBackgroundColorDisabledNoColor")) + assertSnapshot(matching: button, as: .image, named: "UIButtonBackgroundColorDisabledNoColor") } } } diff --git a/ADUtilsTests/UIEdgeInsetsTest.swift b/ADUtilsTests/UIEdgeInsetsTest.swift index f572627..92660e3 100644 --- a/ADUtilsTests/UIEdgeInsetsTest.swift +++ b/ADUtilsTests/UIEdgeInsetsTest.swift @@ -13,7 +13,7 @@ import ADUtils class UIEdgeInsetsTest: QuickSpec { - override func spec() { + override class func spec() { it("should init insets with only one value") { let value: CGFloat = 10 let inset = UIEdgeInsets(value: value) diff --git a/ADUtilsTests/UIImageColorTests.swift b/ADUtilsTests/UIImageColorTests.swift index 635ba90..6b2301e 100644 --- a/ADUtilsTests/UIImageColorTests.swift +++ b/ADUtilsTests/UIImageColorTests.swift @@ -9,11 +9,11 @@ import Foundation import Nimble import Quick import ADUtils -import Nimble_Snapshots +import SnapshotTesting class UIImageColorTests: QuickSpec { - override func spec() { + override class func spec() { it("should have correct snapshot with size") { // Given @@ -25,7 +25,7 @@ class UIImageColorTests: QuickSpec { // Then let imageView = UIImageView(image: image) - expect(imageView).to(haveValidSnapshot(named: "UIImageColorRedWithSize")) + assertSnapshot(matching: imageView, as: .image, named: "UIImageColorRedWithSize") } it("should have correct snapshot without size") { @@ -37,7 +37,7 @@ class UIImageColorTests: QuickSpec { // Then let imageView = UIImageView(image: image) - expect(imageView).to(haveValidSnapshot(named: "UIImageColorRedPixel")) + assertSnapshot(matching: imageView, as: .image, named: "UIImageColorRedPixel") } if #available(iOS 13.0, *) { diff --git a/ADUtilsTests/UINavigationItemBackItemTests.swift b/ADUtilsTests/UINavigationItemBackItemTests.swift index c59285b..abcbe4c 100644 --- a/ADUtilsTests/UINavigationItemBackItemTests.swift +++ b/ADUtilsTests/UINavigationItemBackItemTests.swift @@ -12,7 +12,7 @@ import ADUtils class UINavigationItemBackItemTests: QuickSpec { - override func spec() { + override class func spec() { it("should have an empty title") { // Given diff --git a/ADUtilsTests/UIScreenPixelDimensionTests.swift b/ADUtilsTests/UIScreenPixelDimensionTests.swift index 75e23bc..679cb87 100644 --- a/ADUtilsTests/UIScreenPixelDimensionTests.swift +++ b/ADUtilsTests/UIScreenPixelDimensionTests.swift @@ -19,7 +19,7 @@ private class TestScreen: UIScreen { class UIScreenPixelDimensionTests: QuickSpec { - override func spec() { + override class func spec() { it("should have an empty title") { // Given diff --git a/ADUtilsTests/UITableViewDefaultFooterCellsTests.swift b/ADUtilsTests/UITableViewDefaultFooterCellsTests.swift index a5156f8..b426f63 100644 --- a/ADUtilsTests/UITableViewDefaultFooterCellsTests.swift +++ b/ADUtilsTests/UITableViewDefaultFooterCellsTests.swift @@ -12,7 +12,7 @@ import ADUtils class UITableViewDefaultFooterCellsTests: QuickSpec { - override func spec() { + override class func spec() { it("should have an empty footer") { // Given diff --git a/ADUtilsTests/UITableViewHeaderFooterViewLayoutTests.swift b/ADUtilsTests/UITableViewHeaderFooterViewLayoutTests.swift index 2db4bc0..cc85de0 100644 --- a/ADUtilsTests/UITableViewHeaderFooterViewLayoutTests.swift +++ b/ADUtilsTests/UITableViewHeaderFooterViewLayoutTests.swift @@ -95,7 +95,7 @@ class HeaderFooterBehavior: Behavior { class UITableViewHeaderFooterViewLayoutTests: QuickSpec { - override func spec() { + override class func spec() { itBehavesLike(HeaderFooterBehavior.self) { .header } itBehavesLike(HeaderFooterBehavior.self) { .footer } } diff --git a/ADUtilsTests/ViewInsertionWithMarginTest.swift b/ADUtilsTests/ViewInsertionWithMarginTest.swift index c87d989..cda90b5 100644 --- a/ADUtilsTests/ViewInsertionWithMarginTest.swift +++ b/ADUtilsTests/ViewInsertionWithMarginTest.swift @@ -10,7 +10,7 @@ import Foundation import Foundation import Nimble -import Nimble_Snapshots +import SnapshotTesting import Quick import ADUtils @testable import ADUtilsApp @@ -31,7 +31,7 @@ class IntrinsicContentSizeView : UIView { class ViewInsertionWithMargin: QuickSpec { - override func spec() { + override class func spec() { standardEdgesSpec() if #available(iOS 13, *) { directionalEdgesSpec() @@ -40,7 +40,7 @@ class ViewInsertionWithMargin: QuickSpec { // MARK: - Private - private func standardEdgesSpec() { + private class func standardEdgesSpec() { describe("Pin to superview") { @@ -58,52 +58,52 @@ class ViewInsertionWithMargin: QuickSpec { it("should pin all edges with insets") { subview.ad_pinToSuperview(insets: insets) - expect(view).to(haveValidSnapshot(named: "PinAllEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinAllEdgesWithInsets") } it("should pin top right with insets") { subview.ad_pinToSuperview(edges: [.top, .right], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinTopRightEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinTopRightEdgesWithInsets") } it("should pin top left with insets") { subview.ad_pinToSuperview(edges: [.top, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinTopLeftEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinTopLeftEdgesWithInsets") } it("should pin bottom right with insets") { subview.ad_pinToSuperview(edges: [.bottom, .right], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinBottomRightEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinBottomRightEdgesWithInsets") } it("should pin bottom left with insets") { subview.ad_pinToSuperview(edges: [.bottom, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinBottomLeftEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinBottomLeftEdgesWithInsets") } it("should pin all edges without insets") { subview.ad_pinToSuperview() - expect(view).to(haveValidSnapshot(named: "PinAllEdgesWithoutInsets")) + assertSnapshot(matching: view, as: .image, named: "PinAllEdgesWithoutInsets") } it("should pin top right without insets") { subview.ad_pinToSuperview(edges: [.top, .right]) - expect(view).to(haveValidSnapshot(named: "PinTopRightEdgesWithoutInsets")) + assertSnapshot(matching: view, as: .image, named: "PinTopRightEdgesWithoutInsets") } it("should pin top left without insets") { subview.ad_pinToSuperview(edges: [.top, .left]) - expect(view).to(haveValidSnapshot(named: "PinTopLeftEdgesWithoutInsets")) + assertSnapshot(matching: view, as: .image, named: "PinTopLeftEdgesWithoutInsets") } it("should pin bottom right without insets") { subview.ad_pinToSuperview(edges: [.bottom, .right]) - expect(view).to(haveValidSnapshot(named: "PinBottomRightEdgesWithoutInsets")) + assertSnapshot(matching: view, as: .image, named: "PinBottomRightEdgesWithoutInsets") } it("should pin bottom left without insets") { subview.ad_pinToSuperview(edges: [.bottom, .left]) - expect(view).to(haveValidSnapshot(named: "PinBottomLeftEdgesWithoutInsets")) + assertSnapshot(matching: view, as: .image, named: "PinBottomLeftEdgesWithoutInsets") } } @@ -121,19 +121,19 @@ class ViewInsertionWithMargin: QuickSpec { it("should center in superview") { subview.ad_centerInSuperview() - expect(view).to(haveValidSnapshot(named: "CenterInSuperview")) + assertSnapshot(matching: view, as: .image, named: "CenterInSuperview") } it("should center X in superview") { subview.ad_pinToSuperview(edges: [.top, .bottom]) subview.ad_centerInSuperview(along: .horizontal) - expect(view).to(haveValidSnapshot(named: "CenterXInSuperview")) + assertSnapshot(matching: view, as: .image, named: "CenterXInSuperview") } it("should center Y in superview") { subview.ad_pinToSuperview(edges: [.left, .right]) subview.ad_centerInSuperview(along: .vertical) - expect(view).to(haveValidSnapshot(named: "CenterYInSuperview")) + assertSnapshot(matching: view, as: .image, named: "CenterYInSuperview") } } @@ -152,7 +152,7 @@ class ViewInsertionWithMargin: QuickSpec { it("should constrain to size") { subview.ad_constrain(to: CGSize(width: 50, height: 50)) subview.ad_pinToSuperview(edges: [.top, .left]) - expect(view).to(haveValidSnapshot(named: "ConstrainToSize")) + assertSnapshot(matching: view, as: .image, named: "ConstrainToSize") } } @@ -172,43 +172,43 @@ class ViewInsertionWithMargin: QuickSpec { it("should constrain in superview pin bottom left") { subview.ad_pinToSuperview(edges: [.bottom, .left], insets: insets) subview.ad_constrainInSuperview(edges: [.top, .right], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinBottomLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinBottomLeft") } it("should constrain in superview pin bottom right") { subview.ad_pinToSuperview(edges: [.bottom, .right], insets: insets) subview.ad_constrainInSuperview(edges: [.top, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinBottomRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinBottomRight") } it("should constrain in superview pin top left") { subview.ad_pinToSuperview(edges: [.top, .left], insets: insets) subview.ad_constrainInSuperview(edges: [.bottom, .right], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinTopLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinTopLeft") } it("should constrain in superview pin top right") { subview.ad_pinToSuperview(edges: [.top, .right], insets: insets) subview.ad_constrainInSuperview(edges: [.bottom, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinTopRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinTopRight") } it("should constrain in superview") { subview.ad_centerInSuperview() subview.ad_constrainInSuperview() - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperview")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperview") } it("should constrain in superview with insets") { subview.ad_centerInSuperview() subview.ad_constrainInSuperview(insets: UIEdgeInsets(value: 10.0)) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewWithInsets")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewWithInsets") } it("should constrain in superview with left edge") { subview.ad_centerInSuperview() subview.ad_constrainInSuperview(edges: [.left]) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewWithLeftEdge")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewWithLeftEdge") } } @@ -238,43 +238,43 @@ class ViewInsertionWithMargin: QuickSpec { it("should constrain in superview pin bottom left") { subview.ad_pinToSuperviewSafeAreaLayoutGuide(edges: [.bottom, .left], insets: insets) subview.ad_constrainInSuperviewSafeAreaLayoutGuide(edges: [.top, .right], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinBottomLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinBottomLeft") } it("should constrain in superview pin bottom right") { subview.ad_pinToSuperviewSafeAreaLayoutGuide(edges: [.bottom, .right], insets: insets) subview.ad_constrainInSuperviewSafeAreaLayoutGuide(edges: [.top, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinBottomRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinBottomRight") } it("should constrain in superview pin top left") { subview.ad_pinToSuperviewSafeAreaLayoutGuide(edges: [.top, .left], insets: insets) subview.ad_constrainInSuperviewSafeAreaLayoutGuide(edges: [.bottom, .right], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinTopLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinTopLeft") } it("should constrain in superview pin top right") { subview.ad_pinToSuperviewSafeAreaLayoutGuide(edges: [.top, .right], insets: insets) subview.ad_constrainInSuperviewSafeAreaLayoutGuide(edges: [.bottom, .left], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinTopRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinTopRight") } it("should constrain in superview") { subview.ad_centerInSuperviewSafeAreaLayoutGuide() subview.ad_constrainInSuperviewSafeAreaLayoutGuide() - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeArea")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeArea") } it("should constrain in superview with insets") { subview.ad_centerInSuperviewSafeAreaLayoutGuide() subview.ad_constrainInSuperviewSafeAreaLayoutGuide(insets: UIEdgeInsets(value: 100)) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaWithInsets")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaWithInsets") } it("should constrain in superview with left edge") { subview.ad_centerInSuperviewSafeAreaLayoutGuide() subview.ad_constrainInSuperviewSafeAreaLayoutGuide(edges: [.left]) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaWithLeftEdge")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaWithLeftEdge") } } } @@ -282,7 +282,7 @@ class ViewInsertionWithMargin: QuickSpec { @available(iOS 13.0, *) @available(tvOSApplicationExtension 13.0, *) - private func directionalEdgesSpec() { + private static func directionalEdgesSpec() { describe("Pin to superview") { @@ -300,72 +300,72 @@ class ViewInsertionWithMargin: QuickSpec { it("should pin all edges with insets") { subview.ad_pinToSuperview(insets: insets) - expect(view).to(haveValidSnapshot(named: "PinAllEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinAllEdgesWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinAllEdgesWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinAllEdgesWithInsetsRTLForced") } it("should pin top right with insets") { subview.ad_pinToSuperview(directionalEdges: [.top, .trailing], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinTopRightEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinTopRightEdgesWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinTopRightEdgesWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinTopRightEdgesWithInsetsRTLForced") } it("should pin top left with insets") { subview.ad_pinToSuperview(directionalEdges: [.top, .leading], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinTopLeftEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinTopLeftEdgesWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinTopLeftEdgesWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinTopLeftEdgesWithInsetsRTLForced") } it("should pin bottom right with insets") { subview.ad_pinToSuperview(directionalEdges: [.bottom, .trailing], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinBottomRightEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinBottomRightEdgesWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinBottomRightEdgesWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinBottomRightEdgesWithInsetsRTLForced") } it("should pin bottom left with insets") { subview.ad_pinToSuperview(directionalEdges: [.bottom, .leading], insets: insets) - expect(view).to(haveValidSnapshot(named: "PinBottomLeftEdgesWithInsets")) + assertSnapshot(matching: view, as: .image, named: "PinBottomLeftEdgesWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinBottomLeftEdgesWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinBottomLeftEdgesWithInsetsRTLForced") } it("should pin all edges without insets") { subview.ad_pinToSuperview() - expect(view).to(haveValidSnapshot(named: "PinAllEdgesWithoutInsets")) + assertSnapshot(matching: view, as: .image, named: "PinAllEdgesWithoutInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinAllEdgesWithoutInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinAllEdgesWithoutInsetsRTLForced") } it("should pin top right without insets") { subview.ad_pinToSuperview(directionalEdges: [.top, .trailing]) - expect(view).to(haveValidSnapshot(named: "PinTopRightEdgesWithoutInsets")) + assertSnapshot(matching: view, as: .image, named: "PinTopRightEdgesWithoutInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinTopRightEdgesWithoutInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinTopRightEdgesWithoutInsetsRTLForced") } it("should pin top left without insets") { subview.ad_pinToSuperview(directionalEdges: [.top, .leading]) - expect(view).to(haveValidSnapshot(named: "PinTopLeftEdgesWithoutInsets")) + assertSnapshot(matching: view, as: .image, named: "PinTopLeftEdgesWithoutInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinTopLeftEdgesWithoutInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinTopLeftEdgesWithoutInsetsRTLForced") } it("should pin bottom right without insets") { subview.ad_pinToSuperview(directionalEdges: [.bottom, .trailing]) - expect(view).to(haveValidSnapshot(named: "PinBottomRightEdgesWithoutInsets")) + assertSnapshot(matching: view, as: .image, named: "PinBottomRightEdgesWithoutInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinBottomRightEdgesWithoutInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinBottomRightEdgesWithoutInsetsRTLForced") } it("should pin bottom left without insets") { subview.ad_pinToSuperview(directionalEdges: [.bottom, .leading]) - expect(view).to(haveValidSnapshot(named: "PinBottomLeftEdgesWithoutInsets")) + assertSnapshot(matching: view, as: .image, named: "PinBottomLeftEdgesWithoutInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "PinBottomLeftEdgesWithoutInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "PinBottomLeftEdgesWithoutInsetsRTLForced") } } @@ -383,24 +383,24 @@ class ViewInsertionWithMargin: QuickSpec { it("should center in superview") { subview.ad_centerInSuperview() - expect(view).to(haveValidSnapshot(named: "CenterInSuperview")) - expect(view).to(haveValidSnapshot(named: "CenterInSuperviewRTLForced")) + assertSnapshot(matching: view, as: .image, named: "CenterInSuperview") + assertSnapshot(matching: view, as: .image, named: "CenterInSuperviewRTLForced") } it("should center X in superview") { subview.ad_pinToSuperview(directionalEdges: [.top, .bottom]) subview.ad_centerInSuperview(along: .horizontal) - expect(view).to(haveValidSnapshot(named: "CenterXInSuperview")) + assertSnapshot(matching: view, as: .image, named: "CenterXInSuperview") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "CenterXInSuperviewRTLForced")) + assertSnapshot(matching: view, as: .image, named: "CenterXInSuperviewRTLForced") } it("should center Y in superview") { subview.ad_pinToSuperview(directionalEdges: [.leading, .trailing]) subview.ad_centerInSuperview(along: .vertical) - expect(view).to(haveValidSnapshot(named: "CenterYInSuperview")) + assertSnapshot(matching: view, as: .image, named: "CenterYInSuperview") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "CenterYInSuperviewRTLForced")) + assertSnapshot(matching: view, as: .image, named: "CenterYInSuperviewRTLForced") } } @@ -419,9 +419,9 @@ class ViewInsertionWithMargin: QuickSpec { it("should constrain to size") { subview.ad_constrain(to: CGSize(width: 50, height: 50)) subview.ad_pinToSuperview(directionalEdges: [.top, .leading]) - expect(view).to(haveValidSnapshot(named: "ConstrainToSize")) + assertSnapshot(matching: view, as: .image, named: "ConstrainToSize") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainToSizeRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainToSizeRTLForced") } } @@ -441,57 +441,57 @@ class ViewInsertionWithMargin: QuickSpec { it("should constrain in superview pin bottom left") { subview.ad_pinToSuperview(directionalEdges: [.bottom, .leading], insets: insets) subview.ad_constrainInSuperview(directionalEdges: [.top, .trailing], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinBottomLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinBottomLeft") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinBottomLeftRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinBottomLeftRTLForced") } it("should constrain in superview pin bottom right") { subview.ad_pinToSuperview(directionalEdges: [.bottom, .trailing], insets: insets) subview.ad_constrainInSuperview(directionalEdges: [.top, .leading], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinBottomRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinBottomRight") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinBottomRightRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinBottomRightRTLForced") } it("should constrain in superview pin top left") { subview.ad_pinToSuperview(directionalEdges: [.top, .leading], insets: insets) subview.ad_constrainInSuperview(directionalEdges: [.bottom, .trailing], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinTopLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinTopLeft") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinTopLeftRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinTopLeftRTLForced") } it("should constrain in superview pin top right") { subview.ad_pinToSuperview(directionalEdges: [.top, .trailing], insets: insets) subview.ad_constrainInSuperview(directionalEdges: [.bottom, .leading], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinTopRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinTopRight") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewPinTopRightRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewPinTopRightRTLForced") } it("should constrain in superview") { subview.ad_centerInSuperview() subview.ad_constrainInSuperview() - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperview")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperview") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewRTLForced") } it("should constrain in superview with insets") { subview.ad_centerInSuperview() subview.ad_constrainInSuperview(insets: NSDirectionalEdgeInsets(value: 10.0)) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewWithInsets")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewWithInsets") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewWithInsetsRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewWithInsetsRTLForced") } it("should constrain in superview with left edge") { subview.ad_centerInSuperview() subview.ad_constrainInSuperview(directionalEdges: [.leading]) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewWithLeftEdge")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewWithLeftEdge") view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewWithLeftEdgeRTLForced")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewWithLeftEdgeRTLForced") } } @@ -520,13 +520,13 @@ class ViewInsertionWithMargin: QuickSpec { it("should constrain in superview pin bottom leading") { subview.ad_pinToSuperviewSafeAreaLayoutGuide(directionalEdges: [.bottom, .leading], insets: insets) subview.ad_constrainInSuperviewSafeAreaLayoutGuide(directionalEdges: [.top, .trailing], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinBottomLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinBottomLeft") } it("should constrain in superview pin bottom trailing") { subview.ad_pinToSuperviewSafeAreaLayoutGuide(directionalEdges: [.bottom, .trailing], insets: insets) subview.ad_constrainInSuperviewSafeAreaLayoutGuide(directionalEdges: [.top, .leading], insets: insets) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinBottomRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinBottomRight") } it("should constrain in superview pin top leading") { @@ -535,7 +535,7 @@ class ViewInsertionWithMargin: QuickSpec { directionalEdges: [.bottom, .trailing], insets: insets ) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinTopLeft")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinTopLeft") } it("should constrain in superview pin top trailing") { @@ -544,33 +544,33 @@ class ViewInsertionWithMargin: QuickSpec { directionalEdges: [.bottom, .leading], insets: insets ) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinTopRight")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinTopRight") } it("should constrain in superview with directional insets") { subview.ad_centerInSuperviewSafeAreaLayoutGuide() subview.ad_constrainInSuperviewSafeAreaLayoutGuide(insets: NSDirectionalEdgeInsets(value: 100)) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaWithInsets")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaWithInsets") } it("should constrain in superview with leading edge") { subview.ad_centerInSuperviewSafeAreaLayoutGuide() subview.ad_constrainInSuperviewSafeAreaLayoutGuide(directionalEdges: [.leading]) - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaWithLeftEdge")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaWithLeftEdge") } it("should constrain in superview pin bottom leading") { subview.ad_pinToSuperviewSafeAreaLayoutGuide(directionalEdges: [.bottom, .leading], insets: insets) subview.ad_constrainInSuperviewSafeAreaLayoutGuide(directionalEdges: [.top, .trailing], insets: insets) view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinBottomLeading")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinBottomLeading") } it("should constrain in superview pin bottom trailing") { subview.ad_pinToSuperviewSafeAreaLayoutGuide(directionalEdges: [.bottom, .trailing], insets: insets) subview.ad_constrainInSuperviewSafeAreaLayoutGuide(directionalEdges: [.top, .leading], insets: insets) view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinBottomTrailing")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinBottomTrailing") } it("should constrain in superview pin top leading") { @@ -580,7 +580,7 @@ class ViewInsertionWithMargin: QuickSpec { insets: insets ) view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinTopLeading")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinTopLeading") } it("should constrain in superview pin top trailing") { @@ -590,21 +590,21 @@ class ViewInsertionWithMargin: QuickSpec { insets: insets ) view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaPinTopTrailing")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaPinTopTrailing") } it("should constrain in superview with directional insets") { subview.ad_centerInSuperviewSafeAreaLayoutGuide() subview.ad_constrainInSuperviewSafeAreaLayoutGuide(insets: NSDirectionalEdgeInsets(value: 100)) view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaWithInsets")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaWithInsets") } it("should constrain in superview with leading edge") { subview.ad_centerInSuperviewSafeAreaLayoutGuide() subview.ad_constrainInSuperviewSafeAreaLayoutGuide(directionalEdges: [.leading]) view.semanticContentAttribute = .forceRightToLeft - expect(view).to(haveValidSnapshot(named: "ConstrainInSuperviewSafeAreaWithLeftEdge")) + assertSnapshot(matching: view, as: .image, named: "ConstrainInSuperviewSafeAreaWithLeftEdge") } } } diff --git a/ADUtilsTests/ReferenceImages/AttributedStringTest/DifferentAttributes@2x.png b/ADUtilsTests/__Snapshots__/AttributedStringTest/spec.DifferentAttributes.png similarity index 100% rename from ADUtilsTests/ReferenceImages/AttributedStringTest/DifferentAttributes@2x.png rename to ADUtilsTests/__Snapshots__/AttributedStringTest/spec.DifferentAttributes.png diff --git a/ADUtilsTests/ReferenceImages/AttributedStringTest/EmojiInFormat@2x.png b/ADUtilsTests/__Snapshots__/AttributedStringTest/spec.EmojiInFormat.png similarity index 100% rename from ADUtilsTests/ReferenceImages/AttributedStringTest/EmojiInFormat@2x.png rename to ADUtilsTests/__Snapshots__/AttributedStringTest/spec.EmojiInFormat.png diff --git a/ADUtilsTests/ReferenceImages/AttributedStringTest/InvertedFormat@2x.png b/ADUtilsTests/__Snapshots__/AttributedStringTest/spec.InvertedFormat.png similarity index 100% rename from ADUtilsTests/ReferenceImages/AttributedStringTest/InvertedFormat@2x.png rename to ADUtilsTests/__Snapshots__/AttributedStringTest/spec.InvertedFormat.png diff --git a/ADUtilsTests/ReferenceImages/AttributedStringTest/SameAttributes@2x.png b/ADUtilsTests/__Snapshots__/AttributedStringTest/spec.SameAttributes.png similarity index 100% rename from ADUtilsTests/ReferenceImages/AttributedStringTest/SameAttributes@2x.png rename to ADUtilsTests/__Snapshots__/AttributedStringTest/spec.SameAttributes.png diff --git a/ADUtilsTests/ReferenceImages/AttributedStringTest/SingleFormat@2x.png b/ADUtilsTests/__Snapshots__/AttributedStringTest/spec.SingleFormat.png similarity index 100% rename from ADUtilsTests/ReferenceImages/AttributedStringTest/SingleFormat@2x.png rename to ADUtilsTests/__Snapshots__/AttributedStringTest/spec.SingleFormat.png diff --git a/ADUtilsTests/ReferenceImages/DynamicFontTest/DynamicFontLayoutTest@2x.png b/ADUtilsTests/__Snapshots__/DynamicFontTest/spec.DynamicFontLayoutTest.png similarity index 100% rename from ADUtilsTests/ReferenceImages/DynamicFontTest/DynamicFontLayoutTest@2x.png rename to ADUtilsTests/__Snapshots__/DynamicFontTest/spec.DynamicFontLayoutTest.png diff --git a/ADUtilsTests/__Snapshots__/DynamicFontTest/spec.DynamicFontLayoutXXLTest.png b/ADUtilsTests/__Snapshots__/DynamicFontTest/spec.DynamicFontLayoutXXLTest.png new file mode 100644 index 0000000..bc7624e Binary files /dev/null and b/ADUtilsTests/__Snapshots__/DynamicFontTest/spec.DynamicFontLayoutXXLTest.png differ diff --git a/ADUtilsTests/__Snapshots__/DynamicFontTest/spec.SwiftUIDynamicFontLayoutTest.png b/ADUtilsTests/__Snapshots__/DynamicFontTest/spec.SwiftUIDynamicFontLayoutTest.png new file mode 100644 index 0000000..45e1a7f Binary files /dev/null and b/ADUtilsTests/__Snapshots__/DynamicFontTest/spec.SwiftUIDynamicFontLayoutTest.png differ diff --git a/ADUtilsTests/__Snapshots__/DynamicFontTest/spec.SwiftUIDynamicFontLayoutXXLTest.png b/ADUtilsTests/__Snapshots__/DynamicFontTest/spec.SwiftUIDynamicFontLayoutXXLTest.png new file mode 100644 index 0000000..3cb4cb9 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/DynamicFontTest/spec.SwiftUIDynamicFontLayoutXXLTest.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterInLayoutGuideRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterInLayoutGuide.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterInLayoutGuideRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterInLayoutGuide.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterInSuperviewRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterInLayoutGuideRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterInSuperviewRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterInLayoutGuideRTLForced.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterXInLayoutGuideRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterXInLayoutGuide.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterXInLayoutGuideRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterXInLayoutGuide.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterXInLayoutGuideRTLForced.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterXInLayoutGuideRTLForced.png new file mode 100644 index 0000000..717ed32 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterXInLayoutGuideRTLForced.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterYInLayoutGuideRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterYInLayoutGuide.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterYInLayoutGuideRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterYInLayoutGuide.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterYInLayoutGuideRTLForced.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterYInLayoutGuideRTLForced.png new file mode 100644 index 0000000..8ae0248 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.CenterYInLayoutGuideRTLForced.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuideRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuide.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuideRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuide.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinBottomLeft.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinBottomLeft.png new file mode 100644 index 0000000..57dfdd1 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinBottomLeft.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinBottomLeftRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinBottomLeftRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinBottomLeftRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinBottomLeftRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinBottomRight.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinBottomRight.png new file mode 100644 index 0000000..57dfdd1 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinBottomRight.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinBottomRightRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinBottomRightRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinBottomRightRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinBottomRightRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinTopLeft.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinTopLeft.png new file mode 100644 index 0000000..57dfdd1 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinTopLeft.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinTopLeftRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinTopLeftRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinTopLeftRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinTopLeftRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinTopRight.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinTopRight.png new file mode 100644 index 0000000..57dfdd1 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinTopRight.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinTopRightRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinTopRightRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinTopRightRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuidePinTopRightRTLForced.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideAllEdgesNoInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideAllEdgesNoInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideRTLForced.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuideWithInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideWithInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuideWithInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideWithInsets.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideWithInsetsRTLForced.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideWithInsetsRTLForced.png new file mode 100644 index 0000000..d531cab Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideWithInsetsRTLForced.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuideWithLeftEdgeRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideWithLeftEdge.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuideWithLeftEdgeRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideWithLeftEdge.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideWithLeftEdgeRTLForced.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideWithLeftEdgeRTLForced.png new file mode 100644 index 0000000..0f52a00 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.ConstrainInLayoutGuideWithLeftEdgeRTLForced.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewWithInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideAllEdgesNoInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewWithInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideAllEdgesNoInsets.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideAllEdgesNoInsetsRTLForced.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideAllEdgesNoInsetsRTLForced.png new file mode 100644 index 0000000..5589a08 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideAllEdgesNoInsetsRTLForced.png differ diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideAllEdgesWithInsets.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideAllEdgesWithInsets.png new file mode 100644 index 0000000..6d03c19 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideAllEdgesWithInsets.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideAllEdgesWithInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideAllEdgesWithInsetsRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideAllEdgesWithInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideAllEdgesWithInsetsRTLForced.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideNoSubviewRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideNoSubview.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideNoSubviewRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideNoSubview.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideNoSubviewRTLForced.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideNoSubviewRTLForced.png new file mode 100644 index 0000000..1031341 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideNoSubviewRTLForced.png differ diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesHighPriority.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesHighPriority.png new file mode 100644 index 0000000..a6c01a5 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesHighPriority.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesHighPriorityRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesHighPriorityRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesHighPriorityRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesHighPriorityRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesNoInsets.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesNoInsets.png new file mode 100644 index 0000000..c2a210d Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesNoInsets.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesNoInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesNoInsetsRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesNoInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesNoInsetsRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesWithInsets.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesWithInsets.png new file mode 100644 index 0000000..a6c01a5 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesWithInsets.png differ diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesWithInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesWithInsetsRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesWithInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/directionalEdgesSpec.PinToLayoutGuideTopLeftEdgesWithInsetsRTLForced.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterInLayoutGuide@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.CenterInLayoutGuide.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterInLayoutGuide@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.CenterInLayoutGuide.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterXInLayoutGuide@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.CenterXInLayoutGuide.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterXInLayoutGuide@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.CenterXInLayoutGuide.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterYInLayoutGuide@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.CenterYInLayoutGuide.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/CenterYInLayoutGuide@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.CenterYInLayoutGuide.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuide@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuide.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuide@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuide.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinBottomLeft@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuidePinBottomLeft.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinBottomLeft@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuidePinBottomLeft.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinBottomRight@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuidePinBottomRight.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinBottomRight@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuidePinBottomRight.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinTopLeft@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuidePinTopLeft.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinTopLeft@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuidePinTopLeft.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinTopRight@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuidePinTopRight.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuidePinTopRight@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuidePinTopRight.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuideWithInsets@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuideWithInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuideWithInsets@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuideWithInsets.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuideWithLeftEdge@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuideWithLeftEdge.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/ConstrainInLayoutGuideWithLeftEdge@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.ConstrainInLayoutGuideWithLeftEdge.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideAllEdgesNoInsets@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideAllEdgesNoInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideAllEdgesNoInsets@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideAllEdgesNoInsets.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideAllEdgesWithInsets@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideAllEdgesWithInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideAllEdgesWithInsets@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideAllEdgesWithInsets.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideNoSubview@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideNoSubview.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideNoSubview@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideNoSubview.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesHighPriority@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideTopLeftEdgesHighPriority.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesHighPriority@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideTopLeftEdgesHighPriority.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesNoInsets@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideTopLeftEdgesNoInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesNoInsets@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideTopLeftEdgesNoInsets.png diff --git a/ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesWithInsets@2x.png b/ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideTopLeftEdgesWithInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/LayoutGuideConstraintsTests/PinToLayoutGuideTopLeftEdgesWithInsets@2x.png rename to ADUtilsTests/__Snapshots__/LayoutGuideConstraintsTests/standardEdgesSpec.PinToLayoutGuideTopLeftEdgesWithInsets.png diff --git a/ADUtilsTests/ReferenceImages/StackViewBuilderTests/HStackViewCustom@2x.png b/ADUtilsTests/__Snapshots__/StackViewBuilderTests/spec.HStackViewCustom.png similarity index 100% rename from ADUtilsTests/ReferenceImages/StackViewBuilderTests/HStackViewCustom@2x.png rename to ADUtilsTests/__Snapshots__/StackViewBuilderTests/spec.HStackViewCustom.png diff --git a/ADUtilsTests/ReferenceImages/StackViewBuilderTests/HStackViewDefault@2x.png b/ADUtilsTests/__Snapshots__/StackViewBuilderTests/spec.HStackViewDefault.png similarity index 100% rename from ADUtilsTests/ReferenceImages/StackViewBuilderTests/HStackViewDefault@2x.png rename to ADUtilsTests/__Snapshots__/StackViewBuilderTests/spec.HStackViewDefault.png diff --git a/ADUtilsTests/ReferenceImages/StackViewBuilderTests/VStackViewCustom@2x.png b/ADUtilsTests/__Snapshots__/StackViewBuilderTests/spec.VStackViewCustom.png similarity index 100% rename from ADUtilsTests/ReferenceImages/StackViewBuilderTests/VStackViewCustom@2x.png rename to ADUtilsTests/__Snapshots__/StackViewBuilderTests/spec.VStackViewCustom.png diff --git a/ADUtilsTests/ReferenceImages/StackViewBuilderTests/VStackViewDefault@2x.png b/ADUtilsTests/__Snapshots__/StackViewBuilderTests/spec.VStackViewDefault.png similarity index 100% rename from ADUtilsTests/ReferenceImages/StackViewBuilderTests/VStackViewDefault@2x.png rename to ADUtilsTests/__Snapshots__/StackViewBuilderTests/spec.VStackViewDefault.png diff --git a/ADUtilsTests/ReferenceImages/UIButtonBackgroundColorTests/UIButtonBackgroundColorDisabled@2x.png b/ADUtilsTests/__Snapshots__/UIButtonBackgroundColorTests/spec.UIButtonBackgroundColorDisabled.png similarity index 100% rename from ADUtilsTests/ReferenceImages/UIButtonBackgroundColorTests/UIButtonBackgroundColorDisabled@2x.png rename to ADUtilsTests/__Snapshots__/UIButtonBackgroundColorTests/spec.UIButtonBackgroundColorDisabled.png diff --git a/ADUtilsTests/ReferenceImages/UIButtonBackgroundColorTests/UIButtonBackgroundColorDisabledNoColor@2x.png b/ADUtilsTests/__Snapshots__/UIButtonBackgroundColorTests/spec.UIButtonBackgroundColorDisabledNoColor.png similarity index 100% rename from ADUtilsTests/ReferenceImages/UIButtonBackgroundColorTests/UIButtonBackgroundColorDisabledNoColor@2x.png rename to ADUtilsTests/__Snapshots__/UIButtonBackgroundColorTests/spec.UIButtonBackgroundColorDisabledNoColor.png diff --git a/ADUtilsTests/ReferenceImages/UIButtonBackgroundColorTests/UIButtonBackgroundColorNormal@2x.png b/ADUtilsTests/__Snapshots__/UIButtonBackgroundColorTests/spec.UIButtonBackgroundColorNormal.png similarity index 100% rename from ADUtilsTests/ReferenceImages/UIButtonBackgroundColorTests/UIButtonBackgroundColorNormal@2x.png rename to ADUtilsTests/__Snapshots__/UIButtonBackgroundColorTests/spec.UIButtonBackgroundColorNormal.png diff --git a/ADUtilsTests/ReferenceImages/UIImageColorTests/UIImageColorRedPixel@2x.png b/ADUtilsTests/__Snapshots__/UIImageColorTests/spec.UIImageColorRedPixel.png similarity index 100% rename from ADUtilsTests/ReferenceImages/UIImageColorTests/UIImageColorRedPixel@2x.png rename to ADUtilsTests/__Snapshots__/UIImageColorTests/spec.UIImageColorRedPixel.png diff --git a/ADUtilsTests/ReferenceImages/UIImageColorTests/UIImageColorRedWithSize@2x.png b/ADUtilsTests/__Snapshots__/UIImageColorTests/spec.UIImageColorRedWithSize.png similarity index 100% rename from ADUtilsTests/ReferenceImages/UIImageColorTests/UIImageColorRedWithSize@2x.png rename to ADUtilsTests/__Snapshots__/UIImageColorTests/spec.UIImageColorRedWithSize.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterInSuperview.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterInSuperview.png new file mode 100644 index 0000000..dc5163e Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterInSuperview.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterInSuperviewRTLForced.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterInSuperviewRTLForced.png new file mode 100644 index 0000000..dc5163e Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterInSuperviewRTLForced.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterXInSuperviewRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterXInSuperview.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterXInSuperviewRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterXInSuperview.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterXInSuperviewRTLForced.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterXInSuperviewRTLForced.png new file mode 100644 index 0000000..ba10107 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterXInSuperviewRTLForced.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterYInSuperviewRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterYInSuperview.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterYInSuperviewRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterYInSuperview.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterYInSuperviewRTLForced.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterYInSuperviewRTLForced.png new file mode 100644 index 0000000..2b66fc8 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.CenterYInSuperviewRTLForced.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperview.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperview.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinBottomLeft.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinBottomLeft.png new file mode 100644 index 0000000..5d7be38 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinBottomLeft.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinBottomLeftRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinBottomLeftRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinBottomLeftRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinBottomLeftRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinBottomRight.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinBottomRight.png new file mode 100644 index 0000000..5d7be38 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinBottomRight.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinBottomRightRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinBottomRightRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinBottomRightRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinBottomRightRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinTopLeft.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinTopLeft.png new file mode 100644 index 0000000..5d7be38 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinTopLeft.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinTopLeftRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinTopLeftRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinTopLeftRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinTopLeftRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinTopRight.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinTopRight.png new file mode 100644 index 0000000..5d7be38 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinTopRight.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinTopRightRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinTopRightRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinTopRightRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewPinTopRightRTLForced.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewWithLeftEdgeRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewWithLeftEdgeRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewRTLForced.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinBottomLeading@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomLeading.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinBottomLeading@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomLeading.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinBottomLeft@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomLeft.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinBottomLeft@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomLeft.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinBottomRight@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomRight.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinBottomRight@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomRight.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinBottomTrailing@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomTrailing.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinBottomTrailing@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomTrailing.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopLeading.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopLeading.png new file mode 100644 index 0000000..99dbdf6 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopLeading.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopLeft.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopLeft.png new file mode 100644 index 0000000..cbe146a Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopLeft.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopRight.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopRight.png new file mode 100644 index 0000000..cbe146a Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopRight.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopTrailing.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopTrailing.png new file mode 100644 index 0000000..99dbdf6 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaPinTopTrailing.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaWithInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaWithInsets.png similarity index 68% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaWithInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaWithInsets.png index 445c0ef..7898eab 100644 Binary files a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaWithInsets@2x.png and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaWithInsets.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaWithLeftEdge.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaWithLeftEdge.png new file mode 100644 index 0000000..edecbe5 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewSafeAreaWithLeftEdge.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewWithInsets.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewWithInsets.png new file mode 100644 index 0000000..5589a08 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewWithInsets.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewWithInsetsRTLForced.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewWithInsetsRTLForced.png new file mode 100644 index 0000000..5589a08 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewWithInsetsRTLForced.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinAllEdgesWithoutInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewWithLeftEdge.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinAllEdgesWithoutInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewWithLeftEdge.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewWithLeftEdgeRTLForced.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewWithLeftEdgeRTLForced.png new file mode 100644 index 0000000..7f5703b Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainInSuperviewWithLeftEdgeRTLForced.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopRightEdgesWithoutInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainToSize.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopRightEdgesWithoutInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainToSize.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainToSizeRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainToSizeRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainToSizeRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.ConstrainToSizeRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinAllEdgesWithInsets.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinAllEdgesWithInsets.png new file mode 100644 index 0000000..a8013aa Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinAllEdgesWithInsets.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinAllEdgesWithInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinAllEdgesWithInsetsRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinAllEdgesWithInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinAllEdgesWithInsetsRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinAllEdgesWithoutInsets.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinAllEdgesWithoutInsets.png new file mode 100644 index 0000000..7f5703b Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinAllEdgesWithoutInsets.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinAllEdgesWithoutInsetsRTLForced.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinAllEdgesWithoutInsetsRTLForced.png new file mode 100644 index 0000000..7f5703b Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinAllEdgesWithoutInsetsRTLForced.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomLeftEdgesWithInsets.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomLeftEdgesWithInsets.png new file mode 100644 index 0000000..4f2e36b Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomLeftEdgesWithInsets.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomLeftEdgesWithInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomLeftEdgesWithInsetsRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomLeftEdgesWithInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomLeftEdgesWithInsetsRTLForced.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomRightEdgesWithoutInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomLeftEdgesWithoutInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomRightEdgesWithoutInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomLeftEdgesWithoutInsets.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomLeftEdgesWithoutInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomLeftEdgesWithoutInsetsRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomLeftEdgesWithoutInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomLeftEdgesWithoutInsetsRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomRightEdgesWithInsets.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomRightEdgesWithInsets.png new file mode 100644 index 0000000..786a142 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomRightEdgesWithInsets.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomRightEdgesWithInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomRightEdgesWithInsetsRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomRightEdgesWithInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomRightEdgesWithInsetsRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomRightEdgesWithoutInsets.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomRightEdgesWithoutInsets.png new file mode 100644 index 0000000..dfec6f5 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomRightEdgesWithoutInsets.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomRightEdgesWithoutInsetsRTLForced.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomRightEdgesWithoutInsetsRTLForced.png new file mode 100644 index 0000000..2fdb5ce Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinBottomRightEdgesWithoutInsetsRTLForced.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopLeftEdgesWithInsets.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopLeftEdgesWithInsets.png new file mode 100644 index 0000000..a6f64b8 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopLeftEdgesWithInsets.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopLeftEdgesWithInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopLeftEdgesWithInsetsRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopLeftEdgesWithInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopLeftEdgesWithInsetsRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopLeftEdgesWithoutInsets.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopLeftEdgesWithoutInsets.png new file mode 100644 index 0000000..e26f1d6 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopLeftEdgesWithoutInsets.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopLeftEdgesWithoutInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopLeftEdgesWithoutInsetsRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopLeftEdgesWithoutInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopLeftEdgesWithoutInsetsRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopRightEdgesWithInsets.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopRightEdgesWithInsets.png new file mode 100644 index 0000000..3b6b76a Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopRightEdgesWithInsets.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopRightEdgesWithInsetsRTLForced@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopRightEdgesWithInsetsRTLForced.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopRightEdgesWithInsetsRTLForced@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopRightEdgesWithInsetsRTLForced.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopRightEdgesWithoutInsets.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopRightEdgesWithoutInsets.png new file mode 100644 index 0000000..abdb45f Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopRightEdgesWithoutInsets.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopRightEdgesWithoutInsetsRTLForced.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopRightEdgesWithoutInsetsRTLForced.png new file mode 100644 index 0000000..e26f1d6 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/directionalEdgesSpec.PinTopRightEdgesWithoutInsetsRTLForced.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterInSuperview@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.CenterInSuperview.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterInSuperview@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.CenterInSuperview.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterXInSuperview@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.CenterXInSuperview.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterXInSuperview@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.CenterXInSuperview.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterYInSuperview@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.CenterYInSuperview.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/CenterYInSuperview@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.CenterYInSuperview.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperview@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperview.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperview@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperview.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinBottomLeft@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewPinBottomLeft.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinBottomLeft@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewPinBottomLeft.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinBottomRight@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewPinBottomRight.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinBottomRight@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewPinBottomRight.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinTopLeft@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewPinTopLeft.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinTopLeft@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewPinTopLeft.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinTopRight@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewPinTopRight.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewPinTopRight@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewPinTopRight.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeArea.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeArea.png new file mode 100644 index 0000000..edecbe5 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeArea.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomLeading.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomLeading.png new file mode 100644 index 0000000..12fcc29 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomLeading.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomLeft.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomLeft.png new file mode 100644 index 0000000..8d818c2 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomLeft.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomRight.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomRight.png new file mode 100644 index 0000000..8d818c2 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomRight.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomTrailing.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomTrailing.png new file mode 100644 index 0000000..12fcc29 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinBottomTrailing.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinTopLeading@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinTopLeading.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinTopLeading@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinTopLeading.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinTopLeft.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinTopLeft.png new file mode 100644 index 0000000..cbe146a Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinTopLeft.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinTopRight.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinTopRight.png new file mode 100644 index 0000000..cbe146a Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinTopRight.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinTopTrailing@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinTopTrailing.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewSafeAreaPinTopTrailing@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaPinTopTrailing.png diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaWithInsets.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaWithInsets.png new file mode 100644 index 0000000..7898eab Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaWithInsets.png differ diff --git a/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaWithLeftEdge.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaWithLeftEdge.png new file mode 100644 index 0000000..edecbe5 Binary files /dev/null and b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewSafeAreaWithLeftEdge.png differ diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewWithInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewWithInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewWithInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewWithInsets.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewWithLeftEdge@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewWithLeftEdge.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainInSuperviewWithLeftEdge@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainInSuperviewWithLeftEdge.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainToSize@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainToSize.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/ConstrainToSize@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.ConstrainToSize.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinAllEdgesWithInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinAllEdgesWithInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinAllEdgesWithInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinAllEdgesWithInsets.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinAllEdgesWithoutInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinAllEdgesWithoutInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinAllEdgesWithoutInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinAllEdgesWithoutInsets.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomLeftEdgesWithInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinBottomLeftEdgesWithInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomLeftEdgesWithInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinBottomLeftEdgesWithInsets.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomLeftEdgesWithoutInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinBottomLeftEdgesWithoutInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomLeftEdgesWithoutInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinBottomLeftEdgesWithoutInsets.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomRightEdgesWithInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinBottomRightEdgesWithInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomRightEdgesWithInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinBottomRightEdgesWithInsets.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomRightEdgesWithoutInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinBottomRightEdgesWithoutInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinBottomRightEdgesWithoutInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinBottomRightEdgesWithoutInsets.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopLeftEdgesWithInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinTopLeftEdgesWithInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopLeftEdgesWithInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinTopLeftEdgesWithInsets.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopLeftEdgesWithoutInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinTopLeftEdgesWithoutInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopLeftEdgesWithoutInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinTopLeftEdgesWithoutInsets.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopRightEdgesWithInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinTopRightEdgesWithInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopRightEdgesWithInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinTopRightEdgesWithInsets.png diff --git a/ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopRightEdgesWithoutInsets@2x.png b/ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinTopRightEdgesWithoutInsets.png similarity index 100% rename from ADUtilsTests/ReferenceImages/ViewInsertionWithMarginTest/PinTopRightEdgesWithoutInsets@2x.png rename to ADUtilsTests/__Snapshots__/ViewInsertionWithMarginTest/standardEdgesSpec.PinTopRightEdgesWithoutInsets.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dd398a..456b7b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [11.4.0] - 2023-07-04 + +### Created + +- Add a SwiftUI Font provider in `DynamicFont` + ## [11.3.0] - 2022-08-01Z ### Created diff --git a/Gemfile b/Gemfile index 573023f..a7f19a2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ source 'https://rubygems.org' -ruby '2.6.5' +ruby '3.1.4' -gem 'cocoapods', '1.11.3' -gem 'CFPropertyList', '3.0.0' +gem 'cocoapods', '~> 1.12' +gem 'CFPropertyList', '~> 3.0.0' gem 'fastlane', '<3.0' gem 'danger' gem 'danger-swiftlint' diff --git a/Gemfile.lock b/Gemfile.lock index 9f3d79b..d75279e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,35 +1,35 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.0) - activesupport (6.1.6.1) + CFPropertyList (3.0.6) + rexml + activesupport (7.0.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.4) + public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) artifactory (3.0.15) atomos (0.1.3) - aws-eventstream (1.1.1) - aws-partitions (1.434.0) - aws-sdk-core (3.113.0) + aws-eventstream (1.2.0) + aws-partitions (1.782.0) + aws-sdk-core (3.176.1) aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.239.0) - aws-sigv4 (~> 1.1) - jmespath (~> 1.0) - aws-sdk-kms (1.43.0) - aws-sdk-core (~> 3, >= 3.112.0) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.5) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.68.0) + aws-sdk-core (~> 3, >= 3.176.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.92.0) - aws-sdk-core (~> 3, >= 3.112.0) + aws-sdk-s3 (1.127.0) + aws-sdk-core (~> 3, >= 3.176.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.1) - aws-sigv4 (1.2.3) + aws-sigv4 (~> 1.6) + aws-sigv4 (1.6.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) @@ -37,15 +37,15 @@ GEM cork nap open4 (~> 1.3) - cocoapods (1.11.3) + cocoapods (1.12.1) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.3) + cocoapods-core (= 1.12.1) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-downloader (>= 1.6.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) @@ -53,10 +53,10 @@ GEM gh_inspector (~> 1.0) molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (>= 1.0, < 3.0) + ruby-macho (>= 2.3.0, < 3.0) xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.3) - activesupport (>= 5.0, < 7) + cocoapods-core (1.12.1) + activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) @@ -76,62 +76,79 @@ GEM cocoapods-try (1.2.0) colored (1.2) colored2 (3.1.2) - commander-fastlane (4.4.6) - highline (~> 1.7.2) - concurrent-ruby (1.1.10) + commander (4.6.0) + highline (~> 2.0.0) + concurrent-ruby (1.2.2) cork (0.3.0) colored2 (~> 3.1) - danger (8.2.3) + danger (9.3.1) claide (~> 1.0) claide-plugins (>= 0.9.2) colored2 (~> 3.1) cork (~> 0.1) - faraday (>= 0.9.0, < 2.0) + faraday (>= 0.9.0, < 3.0) faraday-http-cache (~> 2.0) - git (~> 1.7) + git (~> 1.13) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.0) no_proxy_fix - octokit (~> 4.7) + octokit (~> 6.0) terminal-table (>= 1, < 4) - danger-swiftlint (0.24.5) + danger-swiftlint (0.33.0) danger rake (> 10) thor (~> 0.19) declarative (0.0.20) - declarative-option (0.1.0) - digest-crc (0.6.3) + digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.6) - emoji_regex (3.2.2) + dotenv (2.8.1) + emoji_regex (3.2.3) escape (0.0.4) - ethon (0.15.0) + ethon (0.16.0) ffi (>= 1.15.0) - excon (0.79.0) - faraday (1.3.0) + excon (0.100.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) faraday-net_http (~> 1.0) - multipart-post (>= 1.2, < 3) - ruby2_keywords + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) faraday-cookie_jar (0.0.7) faraday (>= 0.8.0) http-cookie (~> 1.0.0) - faraday-http-cache (2.2.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-http-cache (2.5.0) faraday (>= 0.8) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) faraday-net_http (1.0.1) - faraday_middleware (1.0.0) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) faraday (~> 1.0) - fastimage (2.2.3) - fastlane (2.178.0) + fastimage (2.2.7) + fastlane (2.213.0) CFPropertyList (>= 2.3, < 4.0.0) - addressable (>= 2.3, < 3.0.0) + addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) aws-sdk-s3 (~> 1.0) babosa (>= 1.0.3, < 2.0.0) bundler (>= 1.12.0, < 3.0.0) colored - commander-fastlane (>= 4.4.6, < 5.0.0) + commander (~> 4.6) dotenv (>= 2.1.1, < 3.0.0) emoji_regex (>= 0.1, < 4.0) excon (>= 0.71.0, < 1.0.0) @@ -140,19 +157,20 @@ GEM faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) gh_inspector (>= 1.1.2, < 2.0.0) - google-api-client (>= 0.37.0, < 0.39.0) - google-cloud-storage (>= 1.15.0, < 2.0.0) - highline (>= 1.7.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-storage (~> 1.31) + highline (~> 2.0) json (< 3.0.0) jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) - multipart-post (~> 2.0.0) + multipart-post (>= 2.0.0, < 3.0.0) naturally (~> 2.2) + optparse (~> 0.1.1) plist (>= 3.1.0, < 4.0.0) rubyzip (>= 2.0.0, < 3.0.0) security (= 0.1.3) simctl (~> 1.6.3) - slack-notifier (>= 2.0.0, < 3.0.0) terminal-notifier (>= 2.0.0, < 3.0.0) terminal-table (>= 1.4.5, < 2.0.0) tty-screen (>= 0.6.3, < 1.0.0) @@ -166,126 +184,123 @@ GEM fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - git (1.8.1) + git (1.18.0) + addressable (~> 2.8) rchardet (~> 1.8) - google-api-client (0.38.0) + google-apis-androidpublisher_v3 (0.45.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.0) addressable (~> 2.5, >= 2.5.1) - googleauth (~> 0.9) - httpclient (>= 2.8.1, < 3.0) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) mini_mime (~> 1.0) representable (~> 3.0) - retriable (>= 2.0, < 4.0) - signet (~> 0.12) - google-apis-core (0.3.0) - addressable (~> 2.5, >= 2.5.1) - googleauth (~> 0.14) - httpclient (>= 2.8.1, < 3.0) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.0) + retriable (>= 2.0, < 4.a) rexml - signet (~> 0.14) webrick - google-apis-iamcredentials_v1 (0.2.0) - google-apis-core (~> 0.1) - google-apis-storage_v1 (0.3.0) - google-apis-core (~> 0.1) + google-apis-iamcredentials_v1 (0.17.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-playcustomapp_v1 (0.13.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-storage_v1 (0.19.0) + google-apis-core (>= 0.9.0, < 2.a) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) - google-cloud-env (1.5.0) - faraday (>= 0.17.3, < 2.0) - google-cloud-errors (1.1.0) - google-cloud-storage (1.31.0) - addressable (~> 2.5) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.3.1) + google-cloud-storage (1.44.0) + addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.1) - google-cloud-core (~> 1.2) - googleauth (~> 0.9) + google-apis-storage_v1 (~> 0.19.0) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (0.16.0) - faraday (>= 0.17.3, < 2.0) + googleauth (1.6.0) + faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) - signet (~> 0.14) - highline (1.7.10) - http-cookie (1.0.3) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) - jmespath (1.4.0) - json (2.6.2) - jwt (2.2.2) - kramdown (2.3.1) + jmespath (1.6.2) + json (2.6.3) + jwt (2.7.1) + kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) memoist (0.16.2) - mini_magick (4.11.0) - mini_mime (1.0.2) - minitest (5.16.2) + mini_magick (4.12.0) + mini_mime (1.1.2) + minitest (5.18.1) molinillo (0.8.0) multi_json (1.15.0) - multipart-post (2.0.0) + multipart-post (2.3.0) nanaimo (0.3.0) nap (1.1.0) naturally (2.2.1) netrc (0.11.0) no_proxy_fix (0.1.2) - octokit (4.20.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) + octokit (6.1.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) open4 (1.3.4) - os (1.1.1) - plist (3.6.0) + optparse (0.1.1) + os (1.1.4) + plist (3.7.0) public_suffix (4.0.7) - rake (13.0.3) + rake (13.0.6) rchardet (1.8.0) - representable (3.0.4) + representable (3.2.0) declarative (< 0.1.0) - declarative-option (< 0.2.0) + trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.2.4) + rexml (3.2.5) rouge (2.0.7) ruby-macho (2.5.1) - ruby2_keywords (0.0.4) - rubyzip (2.3.0) - sawyer (0.8.2) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + sawyer (0.9.2) addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) + faraday (>= 0.17.3, < 3) security (0.1.3) - signet (0.15.0) - addressable (~> 2.3) - faraday (>= 0.17.3, < 2.0) + signet (0.17.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) - simctl (1.6.8) + simctl (1.6.10) CFPropertyList naturally - slack-notifier (2.3.2) terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) thor (0.20.3) + trailblazer-option (0.1.2) tty-cursor (0.7.1) tty-screen (0.8.1) tty-spinner (0.9.3) tty-cursor (~> 0.7) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) unf (0.1.4) unf_ext - unf_ext (0.0.7.7) - unicode-display_width (1.7.0) - webrick (1.7.0) + unf_ext (0.0.8.2) + unicode-display_width (1.8.0) + webrick (1.8.1) word_wrap (1.0.0) xcodeproj (1.22.0) CFPropertyList (>= 2.3.3, < 4.0) @@ -298,21 +313,20 @@ GEM rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) - zeitwerk (2.6.0) PLATFORMS ruby DEPENDENCIES - CFPropertyList (= 3.0.0) - cocoapods (= 1.11.3) + CFPropertyList (~> 3.0.0) + cocoapods (~> 1.12) danger danger-swiftlint fastlane (< 3.0) fastlane-plugin-changelog RUBY VERSION - ruby 2.6.5p114 + ruby 3.1.4p223 BUNDLED WITH - 2.3.17 + 2.3.16 diff --git a/Modules/ADUtils/DynamicFont.swift b/Modules/ADUtils/DynamicFont.swift index 313e9a4..1abe19f 100644 --- a/Modules/ADUtils/DynamicFont.swift +++ b/Modules/ADUtils/DynamicFont.swift @@ -7,6 +7,7 @@ import Foundation import UIKit +import SwiftUI /** The DynamicFontProvider protocol provides a font depending on parameters @@ -14,10 +15,19 @@ import UIKit public protocol DynamicFontProvider { /** - Provides a font for the given textStyle + Provides a UIKit font for the given textStyle - parameter textStyle: The font text style */ func font(forTextStyle textStyle: UIFont.TextStyle) -> UIFont + + /** + Provides a SwiftUI font for the given textStyle + - parameter textStyle: The font text style + - Note: On iOS 13 the font will scale like the body text style. + From iOS 14 it will scale like the provided text style. + */ + @available(iOS 13.0, tvOS 13.0, *) + func font(forTextStyle textStyle: Font.TextStyle) -> Font } /** @@ -54,6 +64,11 @@ public struct DynamicFont: DynamicFontProvider { public func font(forTextStyle textStyle: UIFont.TextStyle) -> UIFont { return provider.font(forTextStyle: textStyle) } + + @available(iOS 13.0, tvOS 13.0, *) + public func font(forTextStyle textStyle: Font.TextStyle) -> Font { + return provider.font(forTextStyle: textStyle) + } } private struct DefaultDynamicFontProvider: DynamicFontProvider { @@ -63,6 +78,11 @@ private struct DefaultDynamicFontProvider: DynamicFontProvider { func font(forTextStyle textStyle: UIFont.TextStyle) -> UIFont { return UIFont.preferredFont(forTextStyle: textStyle) } + + @available(iOS 13.0, tvOS 13.0, *) + func font(forTextStyle textStyle: Font.TextStyle) -> Font { + return Font.system(textStyle) + } } private struct CustomFontDynamicFontProvider: DynamicFontProvider { @@ -81,6 +101,16 @@ private struct CustomFontDynamicFontProvider: DynamicFontProvider { } } + @available(iOS 13.0, tvOS 13.0, *) + func font(forTextStyle textStyle: Font.TextStyle) -> Font { + do { + return try throwingFont(forTextStyle: textStyle) + } catch { + assertionFailure("[DynamicFont] Missing font for \(fontDescription.name) with style : \(textStyle)") + return Font.system(textStyle) + } + } + // MARK: - Private private var currentSpecifiedContentSizeCategory: UIContentSizeCategory { @@ -92,6 +122,18 @@ private struct CustomFontDynamicFontProvider: DynamicFontProvider { return currentContentSizeCategory } + @available(iOS 13.0, tvOS 13.0, *) + private func throwingFont(forTextStyle textStyle: Font.TextStyle) throws -> Font { + let styleDescription = try fontDescription.fontStyleDescription(for: textStyle) + let customFont: Font + if #available(iOS 14.0, tvOS 14.0, *) { + customFont = Font.custom(styleDescription.name, size: styleDescription.size, relativeTo: textStyle) + } else { + customFont = Font.custom(styleDescription.name, size: styleDescription.size) + } + return customFont + } + private func throwingFont(forTextStyle textStyle: UIFont.TextStyle) throws -> UIFont { let styleDescription = try fontDescription.fontStyleDescription(for: textStyle) let customFont = UIFont(name: styleDescription.name, size: styleDescription.size) diff --git a/Modules/ADUtils/FontDescription.swift b/Modules/ADUtils/FontDescription.swift index fa73a84..e011597 100644 --- a/Modules/ADUtils/FontDescription.swift +++ b/Modules/ADUtils/FontDescription.swift @@ -7,6 +7,7 @@ import Foundation import UIKit +import SwiftUI private typealias FontDescriptionDictionary = [UIFont.TextStyle.RawValue: FontStyleDescription] @@ -59,7 +60,23 @@ struct FontDescription { - returns: the FontStyleDescription corresponding to the text style, as specified in the plist */ func fontStyleDescription(for fontTextStyle: UIFont.TextStyle) throws -> FontStyleDescription { - guard let fontStyleDescription = dictionary[fontTextStyle.rawValue] else { + try fontStyleDescription(for: fontTextStyle.rawValue) + } + + /** + Provides the font for the given text style + - parameter fontTextStyle: the text style + - returns: the FontStyleDescription corresponding to the text style, as specified in the plist + */ + @available(iOS 13.0, tvOS 13.0, *) + func fontStyleDescription(for fontTextStyle: Font.TextStyle) throws -> FontStyleDescription { + try fontStyleDescription(for: fontTextStyle.rawValue) + } + + // MARK: - Private + + private func fontStyleDescription(for stringValue: String) throws -> FontStyleDescription { + guard let fontStyleDescription = dictionary[stringValue] else { throw FontDescriptionError.styleForFontUnavailable } return fontStyleDescription @@ -85,3 +102,45 @@ enum FontDescriptionError: Error { case plistMissing case fontMissing } + +@available(iOS 13.0, tvOS 13.0, *) +fileprivate extension Font.TextStyle { + + // MARK: - Font + + // ???: (Thomas Esterlin) 2023/03/06 I used these values to be able to keep the same plist + // if dev want to use it for both UIKit and SwiftUI + var rawValue: String { + switch self { + case .largeTitle: +#if os(tvOS) + // ???: (Alexandre Podlewski) 03/07/2023 UIFont.TextStyle.largeTitle is not available in tvOS + return "UICTFontTextStyleTitle0" +#else + return UIFont.TextStyle.largeTitle.rawValue +#endif + case .title: + return UIFont.TextStyle.title1.rawValue + case .title2: + return UIFont.TextStyle.title2.rawValue + case .title3: + return UIFont.TextStyle.title3.rawValue + case .headline: + return UIFont.TextStyle.headline.rawValue + case .subheadline: + return UIFont.TextStyle.subheadline.rawValue + case .body: + return UIFont.TextStyle.body.rawValue + case .callout: + return UIFont.TextStyle.callout.rawValue + case .footnote: + return UIFont.TextStyle.footnote.rawValue + case .caption: + return UIFont.TextStyle.caption1.rawValue + case .caption2: + return UIFont.TextStyle.caption2.rawValue + @unknown default: + return "" + } + } +} diff --git a/Modules/ADUtils/UILayoutGuide+Constraints.swift b/Modules/ADUtils/UILayoutGuide+Constraints.swift index 4c9b900..065ecab 100644 --- a/Modules/ADUtils/UILayoutGuide+Constraints.swift +++ b/Modules/ADUtils/UILayoutGuide+Constraints.swift @@ -689,7 +689,7 @@ extension UILayoutGuide { } } -@available(iOS 13.0, *) +@available(iOS 13.0, tvOS 13.0, *) @available(tvOSApplicationExtension 13.0, *) extension UILayoutGuide { /** diff --git a/Modules/ADUtils/UIView+Constraints.swift b/Modules/ADUtils/UIView+Constraints.swift index 212d025..afdf953 100644 --- a/Modules/ADUtils/UIView+Constraints.swift +++ b/Modules/ADUtils/UIView+Constraints.swift @@ -361,7 +361,7 @@ extension UIView { } } -@available(iOS 13.0, *) +@available(iOS 13.0, tvOS 13.0, *) @available(tvOSApplicationExtension 13.0, *) extension UIView { diff --git a/Modules/ADUtils/UIView+LayoutGuideConstraints.swift b/Modules/ADUtils/UIView+LayoutGuideConstraints.swift index b3adcfa..c3a518e 100644 --- a/Modules/ADUtils/UIView+LayoutGuideConstraints.swift +++ b/Modules/ADUtils/UIView+LayoutGuideConstraints.swift @@ -644,7 +644,7 @@ extension UIView { } } -@available(iOS 13.0, *) +@available(iOS 13.0, tvOS 13.0, *) @available(tvOSApplicationExtension 13.0, *) extension UIView { diff --git a/Modules/ADUtils/UIViewController+ChildInsertion.swift b/Modules/ADUtils/UIViewController+ChildInsertion.swift index 5693781..0e63c76 100644 --- a/Modules/ADUtils/UIViewController+ChildInsertion.swift +++ b/Modules/ADUtils/UIViewController+ChildInsertion.swift @@ -63,7 +63,7 @@ extension UIViewController { } } -@available(iOS 13.0, *) +@available(iOS 13.0, tvOS 13.0, *) @available(tvOSApplicationExtension 13.0, *) extension UIViewController { diff --git a/Podfile b/Podfile index 0783c8d..6760170 100644 --- a/Podfile +++ b/Podfile @@ -1,4 +1,4 @@ -platform :ios, '10.0' +platform :ios, '13.0' use_frameworks! target 'ADUtilsApp' do @@ -6,10 +6,9 @@ target 'ADUtilsApp' do end target 'ADUtilsTests' do - pod 'Quick', '~> 2.2' - pod 'Nimble', '~> 10.0' - pod 'Nimble-Snapshots', '~> 9.4' - pod 'OCMock', '~> 3.5' + pod 'Quick', '~> 7.0' + pod 'Nimble', '~> 12.0' + pod 'OCMock', '~> 3.9' pod 'ADUtils', :path => './' pod 'ADUtils/Security', :path => './' end diff --git a/Podfile.lock b/Podfile.lock index 543016c..3c220f4 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,39 +1,26 @@ PODS: - - ADUtils (11.3.0): - - ADUtils/objc (= 11.3.0) - - ADUtils/objc (11.3.0): + - ADUtils (11.4.0): + - ADUtils/objc (= 11.4.0) + - ADUtils/objc (11.4.0): - ADUtils/Swift - - ADUtils/Security (11.3.0) - - ADUtils/Swift (11.3.0) - - iOSSnapshotTestCase (8.0.0): - - iOSSnapshotTestCase/SwiftSupport (= 8.0.0) - - iOSSnapshotTestCase/Core (8.0.0) - - iOSSnapshotTestCase/SwiftSupport (8.0.0): - - iOSSnapshotTestCase/Core - - Nimble (10.0.0) - - Nimble-Snapshots (9.4.0): - - Nimble-Snapshots/Core (= 9.4.0) - - Nimble-Snapshots/Core (9.4.0): - - iOSSnapshotTestCase (~> 8.0) - - Nimble - - OCMock (3.5) - - Quick (2.2.0) + - ADUtils/Security (11.4.0) + - ADUtils/Swift (11.4.0) + - Nimble (12.0.1) + - OCMock (3.9.1) + - Quick (7.0.2) - SwiftLint (0.42.0) DEPENDENCIES: - ADUtils (from `./`) - ADUtils/Security (from `./`) - - Nimble (~> 10.0) - - Nimble-Snapshots (~> 9.4) - - OCMock (~> 3.5) - - Quick (~> 2.2) + - Nimble (~> 12.0) + - OCMock (~> 3.9) + - Quick (~> 7.0) - SwiftLint (~> 0.42.0) SPEC REPOS: trunk: - - iOSSnapshotTestCase - Nimble - - Nimble-Snapshots - OCMock - Quick - SwiftLint @@ -43,14 +30,12 @@ EXTERNAL SOURCES: :path: "./" SPEC CHECKSUMS: - ADUtils: 094de41bd0d4b1ea6f620a62e87fa6dded0bad7b - iOSSnapshotTestCase: a670511f9ee3829c2b9c23e6e68f315fd7b6790f - Nimble: 5316ef81a170ce87baf72dd961f22f89a602ff84 - Nimble-Snapshots: ef281b908c604f78c8313587e25ea92c8ab513d7 - OCMock: 4ab4577fc941af31f4a0398f6e7e230cf21fc72a - Quick: 7fb19e13be07b5dfb3b90d4f9824c855a11af40e + ADUtils: b0c7454b16153e2271e201174fd26ee42004634c + Nimble: b279b3ca9e094508778aab5c76417be158d3ad04 + OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8 + Quick: efab97aca76d60be86c15daa533b2cdfbe1a74d3 SwiftLint: 4fa9579c63416865179bc416f0a92d55f009600d -PODFILE CHECKSUM: f5c75c5a2afe6743b996d26eefe0ea3251125287 +PODFILE CHECKSUM: a085ff0ceae15032eb100393c6df98696f11d7af -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.1 diff --git a/README.md b/README.md index 087af0a..10727f2 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Twitter](https://img.shields.io/badge/twitter-@FabernovelTech-blue.svg?style=flat)](https://twitter.com/FabernovelTech) ![](https://github.com/faberNovel/ADUtils/workflows/CI/badge.svg) -ADUtils is a set of helpers, shortcuts or other tools providing simplified interactions with UIKit and more generally with Swift. +ADUtils is a set of helpers, shortcuts or other tools providing simplified interactions with UIKit and SwiftUI. - [Features](#features) - [ADUtils](#adutils) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 4f296c9..681da75 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -5,7 +5,7 @@ lane :tests do configuration: "Stubs", scheme: "ADUtilsApp", clean: true, - devices: ["iPhone 8"] + devices: ["iPhone SE (3rd generation)"] ) end