Skip to content

Commit

Permalink
chore: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrenskers committed Dec 4, 2021
1 parent e57c561 commit 86f35e6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Tests/SagaTests/SagaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ final class SagaTests: XCTestCase {
XCTAssertEqual(saga.processSteps.count, 1)
}

func testReaderAndItemWriterAndListWriter() throws {
func testReaderAndItemWriterAndListWriter() async throws {
var writtenPages: [WrittenPage] = []
var deletePathCalled = false

Expand All @@ -101,7 +101,7 @@ final class SagaTests: XCTestCase {
deletePathCalled = true
}

let saga = try Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
let saga = try await Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
.register(
metadata: EmptyMetadata.self,
readers: [
Expand Down Expand Up @@ -135,15 +135,15 @@ final class SagaTests: XCTestCase {
XCTAssertEqual(writtenPages[2].content, "<p>test2.md</p><p>test.md</p>")
}

func testYearWriter() throws {
func testYearWriter() async throws {
var writtenPages: [WrittenPage] = []

var mock = FileIO.mock
mock.write = { destination, content in
writtenPages.append(.init(destination: destination, content: content))
}

try Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
try await Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
.register(
metadata: EmptyMetadata.self,
readers: [
Expand All @@ -162,15 +162,15 @@ final class SagaTests: XCTestCase {
])
}

func testTagWriter() throws {
func testTagWriter() async throws {
var writtenPages: [WrittenPage] = []

var mock = FileIO.mock
mock.write = { destination, content in
writtenPages.append(.init(destination: destination, content: content))
}

try Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
try await Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
.register(
metadata: TaggedMetadata.self,
readers: [
Expand All @@ -189,15 +189,15 @@ final class SagaTests: XCTestCase {
])
}

func testStaticFiles() throws {
func testStaticFiles() async throws {
var writtenFiles: [Path] = []

var mock = FileIO.mock
mock.copy = { origin, destination in
writtenFiles.append(destination)
}

try Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
try await Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
.register(
metadata: TaggedMetadata.self,
readers: [
Expand All @@ -212,15 +212,15 @@ final class SagaTests: XCTestCase {
XCTAssertEqual(writtenFiles, ["root/output/style.css"])
}

func testWriteMode() throws {
func testWriteMode() async throws {
var writtenPages: [WrittenPage] = []

var mock = FileIO.mock
mock.write = { destination, content in
writtenPages.append(.init(destination: destination, content: content))
}

let saga = try Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
let saga = try await Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
.register(
metadata: EmptyMetadata.self,
readers: [
Expand Down

0 comments on commit 86f35e6

Please sign in to comment.