summaryrefslogtreecommitdiff
path: root/spec/lib/router_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/router_spec.rb')
-rw-r--r--spec/lib/router_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/router_spec.rb b/spec/lib/router_spec.rb
new file mode 100644
index 0000000..ef56c97
--- /dev/null
+++ b/spec/lib/router_spec.rb
@@ -0,0 +1,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