blob: ef56c97247d1f175bd4dd2c07a8bb7d6808b4517 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
require './lib/spec'
require './lib/router'
class RouterSpec < Spec
context "#call" do
router = Router.new
env = { "REQUEST_PATH" => "/home/5", "REQUEST_METHOD" => "GET" }
router.get("/home/:id") do |params|
"test content 5"
end
expect(router.call(env)).to eq [200, {"Content-Type"=>"text/html"}, ["test content 5"]]
end
call
end
|