summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spec/node_spec.rb12
-rw-r--r--spec/spec_helper.rb3
2 files changed, 15 insertions, 0 deletions
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