summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-01-04 10:05:30 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-01-04 10:05:30 +0100
commit2ff3c8c99b2de6ce379ecd91cae75bef949f0612 (patch)
treed4ec66f01c4d089c7e1e4056572731464978703a /spec
parent824de119f25fe11077c42c22ab77dd1a6d579859 (diff)
downloadzorglub-2ff3c8c99b2de6ce379ecd91cae75bef949f0612.zip
zorglub-2ff3c8c99b2de6ce379ecd91cae75bef949f0612.tar.gz
add Node#map spec
Diffstat (limited to 'spec')
-rw-r--r--spec/node_spec.rb8
-rw-r--r--spec/spec_helper.rb2
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