Skip to content

Commit

Permalink
Modify CurlTestLogging because the extension change to func
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxenceLvl committed Jan 26, 2021
1 parent 2c72d2c commit 64c6f65
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Tests/NetworkingTests/CurlLoggingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class CurlLoggingTests: XCTestCase {
var urlRequest = URLRequest(url: URL(string: "https://jsonplaceholder.typicode.com")!)
urlRequest.httpMethod = "GET"
urlRequest.addValue("token", forHTTPHeaderField: "Authorization")
let result = urlRequest.curlString
let result = urlRequest.toCurlCommand()
XCTAssertEqual(result, "curl \"https://jsonplaceholder.typicode.com\" \\\n\t-H 'Authorization: token'")
}

Expand All @@ -26,7 +26,7 @@ final class CurlLoggingTests: XCTestCase {
{"title": "Hello world"}
"""
urlRequest.httpBody = jsonString.data(using: .utf8)
let result = urlRequest.curlString
let result = urlRequest.toCurlCommand()
XCTAssertEqual(result, "curl \"https://jsonplaceholder.typicode.com/posts\" \\\n\t-X POST \\\n\t-d '{\"title\": \"Hello world\"}'")
}

Expand All @@ -38,7 +38,7 @@ final class CurlLoggingTests: XCTestCase {
{"title": "Hello world"}
"""
urlRequest.httpBody = jsonString.data(using: .utf8)
let result = urlRequest.curlString
let result = urlRequest.toCurlCommand()
XCTAssertEqual(result, "curl \"https://jsonplaceholder.typicode.com/posts\" \\\n\t-X PUT \\\n\t-d '{\"title\": \"Hello world\"}'")
}

Expand All @@ -50,15 +50,15 @@ final class CurlLoggingTests: XCTestCase {
{"title": "Hello world"}
"""
urlRequest.httpBody = jsonString.data(using: .utf8)
let result = urlRequest.curlString
let result = urlRequest.toCurlCommand()
XCTAssertEqual(result, "curl \"https://jsonplaceholder.typicode.com/posts\" \\\n\t-X PATCH \\\n\t-d '{\"title\": \"Hello world\"}'")
}

func testLogDelete() {
var urlRequest = URLRequest(url: URL(string:
"https://jsonplaceholder.typicode.com/posts/1")!)
urlRequest.httpMethod = "DELETE"
let result = urlRequest.curlString
let result = urlRequest.toCurlCommand()
XCTAssertEqual(result, "curl \"https://jsonplaceholder.typicode.com/posts/1\" \\\n\t-X DELETE")
}
}

0 comments on commit 64c6f65

Please sign in to comment.