Template support for input parameters (#4)
This PR contains the work done to support input parameters for the `create` command of the executable target, and to render content dynamically for the newly-generated project. Reviewed-on: #4 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #4.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import AppLibrary
|
||||
import Hummingbird
|
||||
import HummingbirdTesting
|
||||
import Testing
|
||||
|
||||
struct AppTests {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
private let arguments = TestArguments()
|
||||
private let builder = AppBuilder(name: "{{ name }}")
|
||||
|
||||
// MARK: Route tests
|
||||
|
||||
@Test(arguments: ["/"])
|
||||
func routes(_ uri: String) async throws {
|
||||
let app = try await builder(arguments)
|
||||
|
||||
try await app.test(.router) { client in
|
||||
try await client.execute(uri: uri, method: .get) { response in
|
||||
#expect(response.status == .ok)
|
||||
#expect(response.body == .empty)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: ByteBuffer+Constants
|
||||
|
||||
private extension ByteBuffer {
|
||||
static let empty = ByteBuffer(string: "")
|
||||
}
|
||||
Reference in New Issue
Block a user