diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-03 16:19:09 +0100 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-03 16:19:09 +0100 | 
| commit | 7b9bb83a925a9df103de4eb533872ead7f45bb29 (patch) | |
| tree | 1c137430927767904554c2a265ce2270743503cf | |
| parent | 8d828ff3b4e06a7161db63f08e3a74701b51c344 (diff) | |
| download | zorglub-7b9bb83a925a9df103de4eb533872ead7f45bb29.zip zorglub-7b9bb83a925a9df103de4eb533872ead7f45bb29.tar.gz | |
add simple method and 404 specs
| -rw-r--r-- | spec/node_spec.rb | 12 | ||||
| -rw-r--r-- | spec/spec_helper.rb | 3 | 
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 | 
