Removed the unnecessary "fullPath" computed property from the Resource model in the library target.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
import Testing
|
||||
|
||||
@testable import HummingbirdDocC.Resource
|
||||
@testable import struct HummingbirdDocC.Resource
|
||||
|
||||
@Suite("Resource", .tags(.model))
|
||||
struct ResourceTests {
|
||||
@@ -35,15 +35,6 @@ struct ResourceTests {
|
||||
expects: "somedocument"
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
func `full path`() {
|
||||
assertFullPath()(
|
||||
archiveName: "SomeDocument",
|
||||
relativePath: .uriResource,
|
||||
expects: "/somedocument" + .uriResource
|
||||
)
|
||||
}
|
||||
#else
|
||||
@Test("archive path")
|
||||
func archivePath() {
|
||||
@@ -60,15 +51,6 @@ struct ResourceTests {
|
||||
expects: "somedocument"
|
||||
)
|
||||
}
|
||||
|
||||
@Test("full path")
|
||||
func fullPath() {
|
||||
assertFullPath()(
|
||||
archiveName: "SomeDocument",
|
||||
relativePath: .uriResource,
|
||||
expects: "/somedocument" + .uriResource
|
||||
)
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -88,7 +70,7 @@ private extension ResourceTests {
|
||||
expects archivePath: String
|
||||
) {
|
||||
// GIVEN
|
||||
let resource = Resource(
|
||||
var resource = Resource(
|
||||
archiveName: archiveName,
|
||||
relativePath: .empty
|
||||
)
|
||||
@@ -109,7 +91,7 @@ private extension ResourceTests {
|
||||
expects archiveReference: String
|
||||
) {
|
||||
// GIVEN
|
||||
let resource = Resource(
|
||||
var resource = Resource(
|
||||
archiveName: archiveName,
|
||||
relativePath: .empty
|
||||
)
|
||||
@@ -120,28 +102,5 @@ private extension ResourceTests {
|
||||
// THEN
|
||||
#expect(result == archiveReference)
|
||||
}
|
||||
|
||||
/// Asserts the `fullPath` computed property of a resource.
|
||||
/// - Parameters:
|
||||
/// - archiveName: A name of the archive the resource belongs to.
|
||||
/// - relativePath: A relative URI path to a resource.
|
||||
/// - fullPath: An expected relative URI path to a resource in its documentation archive.
|
||||
func assertFullPath(
|
||||
archiveName: String,
|
||||
relativePath: String,
|
||||
expects fullPath: String
|
||||
) {
|
||||
// GIVEN
|
||||
let resource = Resource(
|
||||
archiveName: archiveName,
|
||||
relativePath: relativePath
|
||||
)
|
||||
|
||||
// WHEN
|
||||
let result = resource.fullPath
|
||||
|
||||
// THEN
|
||||
#expect(result == fullPath)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user