From 7b9bb83a925a9df103de4eb533872ead7f45bb29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 3 Jan 2012 16:19:09 +0100 Subject: add simple method and 404 specs --- spec/node_spec.rb | 12 ++++++++++++ spec/spec_helper.rb | 3 +++ 2 files changed, 15 insertions(+) diff --git a/spec/node_spec.rb b/spec/node_spec.rb index 0ef3486..06b7fe0 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -42,6 +42,18 @@ describe Zorglub do Node1.r(1,'arg2',"some").should == "/spec1/1/arg2/some" end # + it "should return err404 response when no method found" do + Node0.respond_to?('noresponse').should be_false + r = Node2.call( {'PATH_INFO'=>'/noresponse'} ) + r.status.should == 404 + end + # + it "simple method should respond" do + r = Node0.call( {'PATH_INFO'=>'/hello'} ) + r.status.should == 200 + r.body[0].should == 'world' + end + # end # end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 146c40a..0a36182 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -33,6 +33,9 @@ end # class Node0 < Zorglub::Node # default + def hello + 'world' + end end # class Node1 < SpecNode -- cgit v1.1-2-g2b99