Skip to content

Commit

Permalink
test: Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrenskers committed Nov 23, 2023
1 parent de206e6 commit d60b71e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 195 deletions.
22 changes: 1 addition & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Create Release
on:
push:
tags:
- '*'
- "*"

jobs:
create-release:
Expand All @@ -28,23 +28,3 @@ jobs:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changelog.outputs.changes }}

- name: Read CHANGELOG.md
id: readfile
uses: juliangruber/read-file-action@v1
with:
path: ./CHANGELOG.md

- name: Write to CHANGELOG.md
uses: DamianReeves/write-file-action@master
with:
path: ./CHANGELOG.md
contents: ${{ steps.changelog.outputs.changelog }}${{ steps.readfile.outputs.content }}
write-mode: overwrite

- name: Commit and push CHANGELOG.md
uses: EndBug/add-and-commit@v7
with:
add: CHANGELOG.md
message: "chore: Update CHANGELOG.md [skip ci]"
branch: main
161 changes: 0 additions & 161 deletions CHANGELOG.md

This file was deleted.

20 changes: 7 additions & 13 deletions Tests/SagaTests/SagaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import XCTest
import PathKit
@testable import Saga

private struct TestMetadata: Metadata {
let property: String
}

extension FileIO {
static var mock = Self(
resolveSwiftPackageFolder: { _ in "root" },
Expand Down Expand Up @@ -65,9 +61,7 @@ final class SagaTests: XCTestCase {
deletePathCalled = true
}

let saga = try Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
XCTAssertEqual(saga.siteMetadata.property, "test")

let saga = try Saga(input: "input", output: "output", fileIO: mock)
XCTAssertEqual(saga.rootPath, "root")
XCTAssertEqual(saga.inputPath, "root/input")
XCTAssertEqual(saga.outputPath, "root/output")
Expand All @@ -82,7 +76,7 @@ final class SagaTests: XCTestCase {
}

func testRegister() throws {
let saga = try Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: .mock)
let saga = try Saga(input: "input", output: "output", fileIO: .mock)
XCTAssertEqual(saga.processSteps.count, 0)

try saga.register(metadata: EmptyMetadata.self, readers: [], writers: [])
Expand All @@ -101,7 +95,7 @@ final class SagaTests: XCTestCase {
deletePathCalled = true
}

let saga = try await Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
let saga = try await Saga(input: "input", output: "output", fileIO: mock)
.register(
metadata: EmptyMetadata.self,
readers: [
Expand Down Expand Up @@ -143,7 +137,7 @@ final class SagaTests: XCTestCase {
writtenPages.append(.init(destination: destination, content: content))
}

try await Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
try await Saga(input: "input", output: "output", fileIO: mock)
.register(
metadata: EmptyMetadata.self,
readers: [
Expand All @@ -170,7 +164,7 @@ final class SagaTests: XCTestCase {
writtenPages.append(.init(destination: destination, content: content))
}

try await Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
try await Saga(input: "input", output: "output", fileIO: mock)
.register(
metadata: TaggedMetadata.self,
readers: [
Expand All @@ -197,7 +191,7 @@ final class SagaTests: XCTestCase {
writtenFiles.append(destination)
}

try await Saga(input: "input", output: "output", siteMetadata: TestMetadata(property: "test"), fileIO: mock)
try await Saga(input: "input", output: "output", fileIO: mock)
.register(
metadata: TaggedMetadata.self,
readers: [
Expand All @@ -220,7 +214,7 @@ final class SagaTests: XCTestCase {
writtenPages.append(.init(destination: destination, content: content))
}

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

0 comments on commit d60b71e

Please sign in to comment.