Skip to content

Commit

Permalink
Merge pull request #97 from finestructure/develop
Browse files Browse the repository at this point in the history
Release 0.8.0
  • Loading branch information
finestructure authored Jul 3, 2020
2 parents dbb8e80 + 6e649e8 commit cce82a4
Show file tree
Hide file tree
Showing 29 changed files with 125 additions and 25 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [finestructure]
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.3
5.2.4
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
- name: macos spm test
stage: test
os: osx
osx_image: xcode11.1
osx_image: xcode11.5
script: make test-macos-spm

- name: macos xcode test
stage: test
os: osx
osx_image: xcode11.1
osx_image: xcode11.5
script: make test-macos-xcode
after_success:
# upload coverage data
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM swift:5.1.3
FROM swift:5.2.4

WORKDIR /package

Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 finestructure OÜ

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ build-docker-app: build-docker-base
docker build --tag rester:$(VERSION) -f Dockerfile.app --build-arg VERSION=$(VERSION) .

test-linux-spm: build-docker-base
# NB: the following requires > 4GB RAM for your docker machine
docker run --rm rester-base swift test --parallel

test-macos-xcode:
Expand Down
12 changes: 6 additions & 6 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"repositoryURL": "https://github.com/mxcl/LegibleError.git",
"state": {
"branch": null,
"revision": "c615c01e461e8a3495ba4ea75f5d671c76820105",
"version": "1.0.1"
"revision": "ce5c54a30ab3d4e8c3d32cbd85557867eb6221ec",
"version": "1.0.3"
}
},
{
Expand All @@ -42,8 +42,8 @@
"repositoryURL": "https://github.com/mxcl/PromiseKit",
"state": {
"branch": null,
"revision": "80963d4317bcdc03891e0fbaa744f20511d1bc08",
"version": "6.12.0"
"revision": "f6b15b7626a4399864ffa1d5ec2ed9cf0cea5556",
"version": "6.13.2"
}
},
{
Expand Down Expand Up @@ -87,8 +87,8 @@
"repositoryURL": "https://github.com/pointfreeco/swift-snapshot-testing.git",
"state": {
"branch": null,
"revision": "12c6a7ce9d67f39a23c6bab757bdb073bd997885",
"version": "1.7.1"
"revision": "2fd91357e90efe82bfa6845d1e7d5bc2f5025d35",
"version": "1.8.1"
}
},
{
Expand Down
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import PackageDescription
let package = Package(
name: "Rester",
platforms: [
.iOS(.v10),
.iOS(.v11),
.macOS(.v10_10),
.tvOS(.v10)
],
products: [
.executable(name: "rester", targets: ["Rester"]),
Expand All @@ -21,7 +22,7 @@ let package = Package(
.package(url: "https://github.com/mxcl/PromiseKit", from: "6.0.0"),
.package(url: "https://github.com/onevcat/Rainbow.git", from: "3.0.0"),
.package(url: "https://github.com/pointfreeco/swift-gen.git", from: "0.2.0"),
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.7.1"),
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.8.1"),
.package(url: "https://github.com/PromiseKit/Foundation.git", from: "3.3.4"),
],
targets: [
Expand Down
4 changes: 4 additions & 0 deletions Tests/ResterTests/Dictionary+extTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 16/04/2019.
//

#if !os(watchOS)

@testable import ResterCore
import XCTest

Expand Down Expand Up @@ -45,3 +47,5 @@ class Dictionary_extTests: XCTestCase {
}

}

#endif // !os(watchOS)
3 changes: 2 additions & 1 deletion Tests/ResterTests/ExampleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
// Created by Sven A. Schmidt on 17/03/2019.
//

#if !os(iOS) && !os(tvOS) && !os(watchOS)

import Path
import Regex
import ResterCore
import SnapshotTesting
import XCTest


#if !os(iOS)
class ExampleTests: XCTestCase {

func test_examples() throws {
Expand Down
4 changes: 4 additions & 0 deletions Tests/ResterTests/IssuesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 01/04/2019.
//

#if !os(watchOS)

import XCTest

import Yams
Expand Down Expand Up @@ -44,3 +46,5 @@ class IssuesTests: XCTestCase {
}

}

#endif // !os(watchOS)
3 changes: 2 additions & 1 deletion Tests/ResterTests/LaunchTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
// Created by Sven A. Schmidt on 19/02/2019.
//

#if !os(iOS) && !os(tvOS) && !os(watchOS)

import XCTest
import SnapshotTesting


#if !os(iOS)
class LaunchTests: XCTestCase {

func test_launch_binary() throws {
Expand Down
4 changes: 4 additions & 0 deletions Tests/ResterTests/MatcherTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 16/04/2019.
//

#if !os(watchOS)

@testable import ResterCore
import XCTest
import Yams
Expand Down Expand Up @@ -125,3 +127,5 @@ class MatcherTests: XCTestCase {
XCTAssertEqual(try Matcher(value: regex), .regex("abc(def)?".r!))
}
}

#endif // !os(watchOS)
4 changes: 4 additions & 0 deletions Tests/ResterTests/ParameterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 14/03/2019.
//

#if !os(watchOS)

import XCTest
@testable import ResterCore

Expand Down Expand Up @@ -39,3 +41,5 @@ class ParameterTests: XCTestCase {
}

}

#endif // !os(watchOS)
4 changes: 4 additions & 0 deletions Tests/ResterTests/PathTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 14/03/2019.
//

#if !os(watchOS)

import XCTest

class PathTests: XCTestCase {
Expand All @@ -15,3 +17,5 @@ class PathTests: XCTestCase {
}

}

#endif // !os(watchOS)
4 changes: 4 additions & 0 deletions Tests/ResterTests/RequestLoggingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 11/04/2019.
//

#if !os(watchOS)

import LegibleError
import Path
@testable import ResterCore
Expand Down Expand Up @@ -140,3 +142,5 @@ class RequestLoggingTests: XCTestCase {
}

}

#endif // !os(watchOS)
4 changes: 4 additions & 0 deletions Tests/ResterTests/RequestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 04/02/2019.
//

#if !os(watchOS)

import XCTest

import Path
Expand Down Expand Up @@ -525,3 +527,5 @@ extension Request.Details {
self.init(url: url, method: nil, headers: nil, query: nil, body: nil, validation: nil, delay: nil, log: nil, variables: nil, when: when)
}
}

#endif // !os(watchOS)
4 changes: 4 additions & 0 deletions Tests/ResterTests/RequestValidationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 11/04/2019.
//

#if !os(watchOS)

@testable import ResterCore
import XCTest
import Yams
Expand Down Expand Up @@ -121,3 +123,5 @@ class RequestValidationTests: XCTestCase {
}

}

#endif // !os(watchOS)
4 changes: 4 additions & 0 deletions Tests/ResterTests/ResponseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 15/04/2019.
//

#if !os(watchOS)

@testable import ResterCore
import XCTest

Expand Down Expand Up @@ -50,3 +52,5 @@ class ResponseTests: XCTestCase {
}

}

#endif // !os(watchOS)
6 changes: 4 additions & 2 deletions Tests/ResterTests/ResterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 19/02/2019.
//

#if !os(watchOS)

import XCTest

import Gen
Expand Down Expand Up @@ -352,7 +354,7 @@ class ResterTests: XCTestCase {
let expectation = self.expectation(description: #function)
_ = r.test(before: {_ in}, after: { (name: $0, result: $1) })
.done { results in
XCTAssertEqual(results.map { $0.name }, ["r2"])
XCTAssertEqual(results.map { $0.name }, ["r1"])
expectation.fulfill()
}.catch {
XCTFail($0.legibleLocalizedDescription)
Expand Down Expand Up @@ -552,4 +554,4 @@ class ResterTests: XCTestCase {

}


#endif // !os(watchOS)
4 changes: 4 additions & 0 deletions Tests/ResterTests/RestfileTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Yams
@testable import ResterCore


#if !os(watchOS)

class RestfileTests: XCTestCase {

func test_decode_variables() throws {
Expand Down Expand Up @@ -291,3 +293,5 @@ class RestfileTests: XCTestCase {
}

}

#endif // !os(watchOS)
4 changes: 4 additions & 0 deletions Tests/ResterTests/StatsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 10/04/2019.
//

#if !os(watchOS)

import XCTest
@testable import ResterCore

Expand Down Expand Up @@ -43,3 +45,5 @@ class StatsTests: XCTestCase {
XCTAssertEqual(values.stddev, 2.19, accuracy: 0.01)
}
}

#endif // !os(watchOS)
4 changes: 4 additions & 0 deletions Tests/ResterTests/SubstitutableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 31/01/2019.
//

#if !os(watchOS)

@testable import ResterCore
import XCTest
import Yams
Expand Down Expand Up @@ -55,3 +57,5 @@ class SubstitutableTests: XCTestCase {
}

}

#endif // !os(watchOS)
4 changes: 4 additions & 0 deletions Tests/ResterTests/TempDir.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 10/04/2019.
//

#if !os(watchOS)

import Foundation
import Path

Expand Down Expand Up @@ -40,3 +42,5 @@ func withTempDir<T>(body: (Path) throws -> T) throws -> T {
let tmp = try TempDir()
return try body(tmp.path)
}

#endif // !os(watchOS)
8 changes: 6 additions & 2 deletions Tests/ResterTests/TestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Sven A. Schmidt on 30/01/2019.
//

#if !os(watchOS)

import Foundation
import Path
import Regex
Expand Down Expand Up @@ -162,7 +164,7 @@ extension String {
}


#if !os(iOS)
#if !os(iOS) && !os(tvOS)
func launch(arguments: [String] = []) throws -> (status: Int32, output: String) {
// Some of the APIs that we use below are available in macOS 10.13 and above.
guard #available(macOS 10.13, *) else {
Expand Down Expand Up @@ -198,7 +200,7 @@ func launch(arguments: [String] = []) throws -> (status: Int32, output: String)
#endif


#if !os(iOS)
#if !os(iOS) && !os(tvOS)
func launch(with requestFile: Path, extraArguments: [String] = []) throws -> (status: Int32, output: String) {
let arguments = [requestFile.string] + extraArguments
let (status, output) = try launch(arguments: arguments)
Expand All @@ -221,3 +223,5 @@ extension Optional {
}
}
}

#endif // !os(watchOS)
Loading

0 comments on commit cce82a4

Please sign in to comment.