Skip to content

Commit

Permalink
Reorganized Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chipp committed Sep 7, 2020
1 parent 16ba949 commit cc9bc54
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 122 deletions.
112 changes: 0 additions & 112 deletions Tests/miniGnomonTests/LoggingSpec.swift

This file was deleted.

Expand Up @@ -56,8 +56,9 @@ class ParamsSpec: XCTestCase {
func testMultipartFormParams() throws {
let form = ["question": "The Ultimate Question of Life, the Universe, and Everything", "answer": "42"]
let expected = String(data: try Data(
contentsOf: URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("Fixtures")
.appendingPathComponent("multipart-simple").appendingPathExtension("txt")
contentsOf: URL(fileURLWithPath: #file)
.deletingLastPathComponent().deletingLastPathComponent()
.appendingPathComponent("Fixtures").appendingPathComponent("multipart-simple").appendingPathExtension("txt")
), encoding: .utf8)!

for method in bodyMethods {
Expand All @@ -76,14 +77,16 @@ class ParamsSpec: XCTestCase {

func testMultipartFilesParams() throws {
let data = try Data(
contentsOf: URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("Fixtures")
.appendingPathComponent("lorem-ipsum").appendingPathExtension("txt")
contentsOf: URL(fileURLWithPath: #file)
.deletingLastPathComponent().deletingLastPathComponent()
.appendingPathComponent("Fixtures").appendingPathComponent("lorem-ipsum").appendingPathExtension("txt")
)
let file = MultipartFile(data: data, contentType: "text/plain", filename: "lorem-ipsum.txt")

let expected = String(data: try Data(
contentsOf: URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("Fixtures")
.appendingPathComponent("multipart-file").appendingPathExtension("txt")
contentsOf: URL(fileURLWithPath: #file)
.deletingLastPathComponent().deletingLastPathComponent()
.appendingPathComponent("Fixtures").appendingPathComponent("multipart-file").appendingPathExtension("txt")
), encoding: .utf8)!

for method in bodyMethods {
Expand All @@ -105,14 +108,16 @@ class ParamsSpec: XCTestCase {
func testMultipartMixedParams() throws {
let form = ["question": "The Ultimate Question of Life, the Universe, and Everything"]
let data = try Data(
contentsOf: URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("Fixtures")
.appendingPathComponent("lorem-ipsum").appendingPathExtension("txt")
contentsOf: URL(fileURLWithPath: #file)
.deletingLastPathComponent().deletingLastPathComponent()
.appendingPathComponent("Fixtures").appendingPathComponent("lorem-ipsum").appendingPathExtension("txt")
)
let file = MultipartFile(data: data, contentType: "text/plain", filename: "lorem-ipsum.txt")

let expected = String(data: try Data(
contentsOf: URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("Fixtures")
.appendingPathComponent("multipart-mixed").appendingPathExtension("txt")
contentsOf: URL(fileURLWithPath: #file)
.deletingLastPathComponent().deletingLastPathComponent()
.appendingPathComponent("Fixtures").appendingPathComponent("multipart-mixed").appendingPathExtension("txt")
), encoding: .utf8)!

for method in bodyMethods {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cc9bc54

Please sign in to comment.