diff --git a/src/spec-kemal.cr b/src/spec-kemal.cr index 96f5475..851cafd 100644 --- a/src/spec-kemal.cr +++ b/src/spec-kemal.cr @@ -4,6 +4,7 @@ require "kemal" TIME_TO_SLEEP = 0.00001 APP_PORT = 1989 APP_ENV = "test" +APP_URL = "http://localhost:#{APP_PORT}" Kemal.config.env = APP_ENV Kemal.config.port = APP_PORT @@ -21,3 +22,9 @@ Spec.after_each do Kemal.config.server.close end end + +{% for method in %w(get post put head delete patch) %} + def {{method.id}}(path, headers : HTTP::Headers? = nil, body : String? = nil) + HTTP::Client.{{method.id}}(APP_URL + path, headers, body) + end +{% end %}