Skip to content

Commit

Permalink
Fix tests for swift 42 (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcgill88 committed Sep 25, 2018
1 parent 9351fdb commit e6f8dc8
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
- LANG=en_US.UTF-8
matrix:
- DESTINATION="OS=12.0,name=iPhone XS" SDK="iphonesimulator12.0" POD_LINT="YES" SWIFT_LINT="YES"
- DESTINATION="OS=11.4,name=iPhone 8" SDK="iphonesimulator12.0" POD_LINT="YES" SWIFT_LINT="YES"
- DESTINATION="OS=11.4,name=iPhone 8" SDK="iphonesimulator12.0" POD_LINT="NO" SWIFT_LINT="NO"
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SDK="iphonesimulator12.0" POD_LINT="NO" SWIFT_LINT="NO"
- DESTINATION="OS=9.3,name=iPhone 6" SDK="iphonesimulator12.0" POD_LINT="NO" SWIFT_LINT="NO"
# - DESTINATION="OS=8.4,name=iPhone 5S" SDK="iphonesimulator12.0" POD_LINT="NO" SWIFT_LINT="NO"
Expand Down
48 changes: 11 additions & 37 deletions Example/McPicker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@
607FACCD1AFB9204008FA782 /* Frameworks */,
607FACCE1AFB9204008FA782 /* Resources */,
C47D12FBF936BCA4F2FC5DF5 /* [CP] Embed Pods Frameworks */,
973D169A1B9454CE644A8880 /* [CP] Copy Pods Resources */,
7218E36A1F0EA822003423A2 /* ShellScript */,
);
buildRules = (
Expand All @@ -195,7 +194,6 @@
607FACE21AFB9204008FA782 /* Frameworks */,
607FACE31AFB9204008FA782 /* Resources */,
48272FBEB2AC4541EBD289D6 /* [CP] Embed Pods Frameworks */,
9DE3F95F620581BF19411B68 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -214,7 +212,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
Expand Down Expand Up @@ -317,36 +315,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
973D169A1B9454CE644A8880 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-McPicker_Example/Pods-McPicker_Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
9DE3F95F620581BF19411B68 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-McPicker_Tests/Pods-McPicker_Tests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
C47D12FBF936BCA4F2FC5DF5 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -446,12 +414,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -484,6 +454,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -499,12 +470,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand All @@ -529,6 +502,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -547,7 +521,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -566,7 +540,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand All @@ -585,7 +559,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -599,7 +573,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,7 +40,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -70,7 +69,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -10,7 +10,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand All @@ -31,7 +30,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
2 changes: 1 addition & 1 deletion Example/McPicker/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
Expand Down
8 changes: 4 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- McPicker (0.5.2)
- McPicker (2.0.0)

DEPENDENCIES:
- McPicker (from `../`)

EXTERNAL SOURCES:
McPicker:
:path: ../
:path: "../"

SPEC CHECKSUMS:
McPicker: 05016caf44615afc93617b9effa4f1648f3223d6
McPicker: 184bd2403f48f1b69e8384d2dbcd4fcff4c0df5f

PODFILE CHECKSUM: 7f68cc3d721452977903943f3af774acc3f68ed4

COCOAPODS: 1.3.1
COCOAPODS: 1.5.0
4 changes: 2 additions & 2 deletions Example/Tests/McPickerBarButtonItemTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class McPickerBarButtonItemTests: XCTestCase {
}

func testInitDone_noTitleCustomStyle() {
let item = McPickerBarButtonItem.done(mcPicker: mcPicker, barButtonSystemItem: UIBarButtonSystemItem.save)
let item = McPickerBarButtonItem.done(mcPicker: mcPicker, barButtonSystemItem: UIBarButtonItem.SystemItem.save)

XCTAssertNil(item.title)
XCTAssertTrue(item.style == .plain)
Expand Down Expand Up @@ -68,7 +68,7 @@ class McPickerBarButtonItemTests: XCTestCase {
}

func testInitCancel_noTitleCustomStyle() {
let item = McPickerBarButtonItem.cancel(mcPicker: mcPicker, barButtonSystemItem: UIBarButtonSystemItem.save)
let item = McPickerBarButtonItem.cancel(mcPicker: mcPicker, barButtonSystemItem: UIBarButtonItem.SystemItem.save)

XCTAssertNil(item.title)
XCTAssertTrue(item.style == .plain)
Expand Down
16 changes: 8 additions & 8 deletions Example/Tests/McPickerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ class McPickerTests: XCTestCase {

// Then
//
XCTAssertEqual(expectedFont, cancelBarButton.titleTextAttributes(for: .normal)?[NSAttributedStringKey.font.rawValue] as! UIFont)
XCTAssertEqual(expectedFont, doneBarButton.titleTextAttributes(for: .normal)?[NSAttributedStringKey.font.rawValue] as! UIFont)
XCTAssertEqual(expectedFont, cancelBarButton.titleTextAttributes(for: .selected)?[NSAttributedStringKey.font.rawValue] as! UIFont)
XCTAssertEqual(expectedFont, doneBarButton.titleTextAttributes(for: .selected)?[NSAttributedStringKey.font.rawValue] as! UIFont)
XCTAssertEqual(expectedFont, cancelBarButton.titleTextAttributes(for: .normal)?[NSAttributedString.Key.font] as! UIFont)
XCTAssertEqual(expectedFont, doneBarButton.titleTextAttributes(for: .normal)?[NSAttributedString.Key.font] as! UIFont)
XCTAssertEqual(expectedFont, cancelBarButton.titleTextAttributes(for: .selected)?[NSAttributedString.Key.font] as! UIFont)
XCTAssertEqual(expectedFont, doneBarButton.titleTextAttributes(for: .selected)?[NSAttributedString.Key.font] as! UIFont)
}

func testSetToolbarItemsFont_afterToolbarItemsSet() {
Expand All @@ -253,10 +253,10 @@ class McPickerTests: XCTestCase {

// Then
//
XCTAssertEqual(expectedFont, cancelButton.titleTextAttributes(for: .normal)?[NSAttributedStringKey.font.rawValue] as! UIFont)
XCTAssertEqual(expectedFont, fireButton.titleTextAttributes(for: .normal)?[NSAttributedStringKey.font.rawValue] as! UIFont)
XCTAssertEqual(expectedFont, cancelButton.titleTextAttributes(for: .selected)?[NSAttributedStringKey.font.rawValue] as! UIFont)
XCTAssertEqual(expectedFont, fireButton.titleTextAttributes(for: .selected)?[NSAttributedStringKey.font.rawValue] as! UIFont)
XCTAssertEqual(expectedFont, cancelButton.titleTextAttributes(for: .normal)?[NSAttributedString.Key.font] as! UIFont)
XCTAssertEqual(expectedFont, fireButton.titleTextAttributes(for: .normal)?[NSAttributedString.Key.font] as! UIFont)
XCTAssertEqual(expectedFont, cancelButton.titleTextAttributes(for: .selected)?[NSAttributedString.Key.font] as! UIFont)
XCTAssertEqual(expectedFont, fireButton.titleTextAttributes(for: .selected)?[NSAttributedString.Key.font] as! UIFont)
}

func testSetPickerBackgroundColor() {
Expand Down

0 comments on commit e6f8dc8

Please sign in to comment.