Skip to content

Commit

Permalink
Fix: ambiguous reference to member 'dataTask(with:completionHandler:)' (
Browse files Browse the repository at this point in the history
#648)

* Fix ambiguous reference to member 'dataTask(with:completionHandler:)'

* Travis: update Fastlane

* Travis: setup Carthage

* Travis: Fastlane already installed

* Travis: upgrade Carthage
  • Loading branch information
ricardopereira authored Nov 16, 2017
1 parent 2027ee3 commit 17dfe4b
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 18 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ env:
- LANG=en_US.UTF-8
before_install:
install:
# Install Scan
- gem install scan -v 0.14.2
- brew update
- brew upgrade carthage
# CocoaPods
- pod install
# Carthage
- carthage bootstrap
script:
# Run tests
# Use `travis_wait` when a long running command or compile step regularly takes longer than 10 minutes without producing any output.
# It writes a short line to the build log every minute for 20 minutes, extending the amount of time your command has to finish.
# Prefix `travis_wait` with a greater number to extend the wait time.
- scan --scheme "Ably" --open_report false --devices "iPhone 6s"
- fastlane scan --scheme "Ably" --open_report false --devices "iPhone 6s"
- bash ./Scripts/run_examples_tests.sh
8 changes: 4 additions & 4 deletions Examples/Tests/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Ably (1.0.6):
- Ably (1.0.9):
- KSCrashAblyFork (= 1.15.8-ably-1)
- msgpack (= 0.1.8)
- SocketRocket (= 0.5.1)
Expand Down Expand Up @@ -74,14 +74,14 @@ DEPENDENCIES:

EXTERNAL SOURCES:
Ably:
:path: "../.."
:path: ../..

SPEC CHECKSUMS:
Ably: 86578d591c0a840c82e099a73e23b29466ff6af5
Ably: cc4bc164d4c5a0b904b1390b54985c7fadfd939f
KSCrashAblyFork: 6d0dd5b033710109a8fdde28103eeb0e7f9ba1f7
msgpack: 97491d2ea799408f4694f2c7d7fd79baf77853dd
SocketRocket: d57c7159b83c3c6655745cd15302aa24b6bae531

PODFILE CHECKSUM: 6af34bf7f91045b23539816c1d0cfe253bec5ea5

COCOAPODS: 1.2.1
COCOAPODS: 1.3.1
28 changes: 26 additions & 2 deletions Examples/Tests/Tests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Tests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
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;
};
4B4F9EED98BC61874DAB2F62 /* [CP] Check Pods Manifest.lock */ = {
Expand All @@ -256,13 +259,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-TestsTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
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;
};
751C5C44401069CC5CAAEE9B /* [CP] Embed Pods Frameworks */ = {
Expand All @@ -271,9 +277,18 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Ably/Ably.framework",
"${BUILT_PRODUCTS_DIR}/KSCrashAblyFork/KSCrashAblyFork.framework",
"${BUILT_PRODUCTS_DIR}/SocketRocket/SocketRocket.framework",
"${BUILT_PRODUCTS_DIR}/msgpack/msgpack.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Ably.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KSCrashAblyFork.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SocketRocket.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/msgpack.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -316,9 +331,18 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-TestsTests/Pods-TestsTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Ably/Ably.framework",
"${BUILT_PRODUCTS_DIR}/KSCrashAblyFork/KSCrashAblyFork.framework",
"${BUILT_PRODUCTS_DIR}/SocketRocket/SocketRocket.framework",
"${BUILT_PRODUCTS_DIR}/msgpack/msgpack.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Ably.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KSCrashAblyFork.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SocketRocket.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/msgpack.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down
16 changes: 8 additions & 8 deletions Examples/Tests/TestsTests/TestsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import XCTest
import Ably
@testable import Tests



class TestsTests: XCTestCase {

let options: ARTClientOptions! = nil

func testAblyWorks() {
Expand All @@ -26,14 +25,14 @@ class TestsTests: XCTestCase {
"Accept" : "application/json",
"Content-Type" : "application/json"
]
URLSession.shared.dataTask(with: request, completionHandler: { data, _, error in
URLSession.shared.dataTask(with: request as URLRequest) { data, _, error in
defer { postAppExpectation.fulfill() }
if let e = error {
XCTFail("Error setting up sandbox app: \(e)")
return
}
responseData = data
}) .resume()
}.resume()
self.waitForExpectations(timeout: 10, handler: nil)

guard let key = responseData
Expand Down Expand Up @@ -65,22 +64,23 @@ class TestsTests: XCTestCase {

let backgroundRealtimeExpectation = self.expectation(description: "Realtime in a Background Queue")
var realtime: ARTRealtime! //strong reference
URLSession.shared.dataTask(with: URL(string:"https://ably.io")!, completionHandler: { _ in
URLSession.shared.dataTask(with: URL(string: "https://ably.io")!) { _ in
realtime = ARTRealtime(key: key as String)
realtime.channels.get("foo").attach { _ in
defer { backgroundRealtimeExpectation.fulfill() }
}
}) .resume()
} .resume()
self.waitForExpectations(timeout: 10, handler: nil)

let backgroundRestExpectation = self.expectation(description: "Rest in a Background Queue")
var rest: ARTRest! //strong reference
URLSession.shared.dataTask(with: URL(string:"https://ably.io")!, completionHandler: { _ in
URLSession.shared.dataTask(with: URL(string: "https://ably.io")!) { _ in
rest = ARTRest(key: key as String)
rest.channels.get("foo").history { _ in
defer { backgroundRestExpectation.fulfill() }
}
}) .resume()
}.resume()
self.waitForExpectations(timeout: 10, handler: nil)
}

}
2 changes: 1 addition & 1 deletion Scripts/run_examples_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e

cd "Examples/Tests"
pod install
scan -s Tests
fastlane scan -s Tests

0 comments on commit 17dfe4b

Please sign in to comment.