From 2ff3c8c99b2de6ce379ecd91cae75bef949f0612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 4 Jan 2012 10:05:30 +0100 Subject: add Node#map spec --- spec/node_spec.rb | 8 +++++++- spec/spec_helper.rb | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/node_spec.rb b/spec/node_spec.rb index 889ba7c..8b2d40a 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -37,6 +37,12 @@ describe Zorglub do Node1.r(1,'arg2',"some").should == "/node1/1/arg2/some" end # + it "instance level map should work" do + r = Node0.my_call '/with_2args/1/2' + h = YAML.load r.body[0] + h[:map].should == '/node0' + end + # it "should return err404 response when no method found" do Node0.respond_to?('noresponse').should be_false r = Node0.my_call '/noresponse' @@ -49,7 +55,7 @@ describe Zorglub do r.body[0].should == 'world' end # - it "arguments should work" do + it "instance level args should work" do r = Node0.my_call '/with_2args/1/2' h = YAML.load r.body[0] h[:args][0].should == '1' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6509357..3a7e5fb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -12,7 +12,7 @@ require 'yaml' # require 'zorglub' # -HASH_PROC = Proc.new { |path,obj| {:path=>path,:layout=>obj.layout,:view=>obj.view,:args=>obj.args}.to_yaml } +HASH_PROC = Proc.new { |path,obj| {:path=>path,:layout=>obj.layout,:view=>obj.view,:args=>obj.args,:map=>obj.map}.to_yaml } RENDER_PROC = Proc.new { |path,obj| case obj.state when :layout -- cgit v1.1-2-g2b99