mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Renamed all occurrences of ctx to env
This commit is contained in:
parent
5bc81e7e5b
commit
a0c909621c
3 changed files with 16 additions and 16 deletions
|
@ -13,8 +13,8 @@ describe "Kemal::Handler" do
|
|||
|
||||
it "routes request with query string" do
|
||||
kemal = Kemal::Handler.new
|
||||
kemal.add_route "GET", "/" do |ctx|
|
||||
"hello #{ctx.params["message"]}"
|
||||
kemal.add_route "GET", "/" do |env|
|
||||
"hello #{env.params["message"]}"
|
||||
end
|
||||
request = HTTP::Request.new("GET", "/?message=world")
|
||||
response = kemal.call(request)
|
||||
|
@ -23,8 +23,8 @@ describe "Kemal::Handler" do
|
|||
|
||||
it "routes request with multiple query strings" do
|
||||
kemal = Kemal::Handler.new
|
||||
kemal.add_route "GET", "/" do |ctx|
|
||||
"hello #{ctx.params["message"]} time #{ctx.params["time"]}"
|
||||
kemal.add_route "GET", "/" do |env|
|
||||
"hello #{env.params["message"]} time #{env.params["time"]}"
|
||||
end
|
||||
request = HTTP::Request.new("GET", "/?message=world&time=now")
|
||||
response = kemal.call(request)
|
||||
|
@ -33,8 +33,8 @@ describe "Kemal::Handler" do
|
|||
|
||||
it "route parameter has more precedence than query string arguments" do
|
||||
kemal = Kemal::Handler.new
|
||||
kemal.add_route "GET", "/:message" do |ctx|
|
||||
"hello #{ctx.params["message"]}"
|
||||
kemal.add_route "GET", "/:message" do |env|
|
||||
"hello #{env.params["message"]}"
|
||||
end
|
||||
request = HTTP::Request.new("GET", "/world?message=coco")
|
||||
response = kemal.call(request)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue