Skip to content

Commit

Permalink
Merge pull request #22 from skylab-inc/master
Browse files Browse the repository at this point in the history
Updated for Swift 4
  • Loading branch information
yannickl authored Jan 23, 2018
2 parents be47f5a + e4cd3d1 commit 5c8fa7f
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 8 deletions.
16 changes: 16 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "PromiseKit",
"repositoryURL": "https://github.com/mxcl/PromiseKit.git",
"state": {
"branch": null,
"revision": "61f796319b16f0d4f3a8cd939d8e7f9a74963038",
"version": "4.3.2"
}
}
]
},
"version": 1
}
19 changes: 18 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
/*
* AwaitKit
*
Expand Down Expand Up @@ -28,7 +30,22 @@ import PackageDescription

let package = Package(
name: "AwaitKit",
products: [
.library(
name: "AwaitKit",
targets: ["AwaitKit"]),
],
dependencies: [
.Package(url: "https://github.com/mxcl/PromiseKit.git", majorVersion: 4, minor: 3)
.package(url: "https://github.com/mxcl/PromiseKit.git", from: "4.3.0")
],
targets: [
.target(
name: "AwaitKit",
dependencies: [
"PromiseKit",
]),
.testTarget(
name: "AwaitKitTests",
dependencies: ["AwaitKit"]),
]
)
1 change: 1 addition & 0 deletions Sources/AwaitKit.swift → Sources/AwaitKit/AwaitKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import Foundation
import PromiseKit
import Dispatch

/// Convenience struct to make the background job.
public struct Queue {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

import Foundation
import Dispatch

/// The generic object to add an `ak` category. Here the base will be the DispatchQueue.
public final class Extension<Base> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import Foundation
import PromiseKit
import Dispatch

extension Extension where Base: DispatchQueue {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import Foundation
import PromiseKit
import Dispatch

extension Extension where Base: DispatchQueue {
/**
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AwaitKitAwaitTests: XCTestCase {

func testNoValueAwaitPromise() {
let promise: Promise<Void> = Promise { resolve, reject in
resolve()
resolve(())
}

XCTAssertNotNil(promise.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import XCTest

class AwaitKitTests: XCTestCase {
func testExcludeSameQueue() {
let promise = Promise { resolve, reject in
resolve()
let promise = Promise<Void> { resolve, reject in
resolve(())
}

XCTAssertThrowsError(try DispatchQueue.main.ak.await(promise))
Expand All @@ -40,8 +40,8 @@ class AwaitKitTests: XCTestCase {
func testAsyncAndAwaitOnDifferentQueue() {
let expect = expectation(description: "Async should fulfill")

let promise = Promise { resolve, reject in
resolve()
let promise = Promise<Void> { resolve, reject in
resolve(())
}

let result: Promise<Void> = async {
Expand All @@ -58,8 +58,8 @@ class AwaitKitTests: XCTestCase {
func testImbricationQueue() {
let expect = expectation(description: "Async should fulfill")

let promise = Promise { resolve, reject in
resolve()
let promise = Promise<Void> { resolve, reject in
resolve(())
}

let result: Promise<Void> = async {
Expand Down
File renamed without changes.
Empty file added Tests/LinuxMain.swift
Empty file.

0 comments on commit 5c8fa7f

Please sign in to comment.