summaryrefslogtreecommitdiffstats
path: root/spec/node_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-01-04 09:14:04 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-01-04 09:14:04 +0100
commite782955f6f6b0814685c9377b6663a76d18c0b7b (patch)
treeaababd07598d44e4af2cc4d823afd8d1bf58d908 /spec/node_spec.rb
parent50b5749972b78a5a4e03e5c2075e884296f0269d (diff)
downloadzorglub-e782955f6f6b0814685c9377b6663a76d18c0b7b.zip
zorglub-e782955f6f6b0814685c9377b6663a76d18c0b7b.tar.gz
Node swallows defs as inherited_vars, update specs
Diffstat (limited to 'spec/node_spec.rb')
-rw-r--r--spec/node_spec.rb30
1 files changed, 12 insertions, 18 deletions
diff --git a/spec/node_spec.rb b/spec/node_spec.rb
index 4b4fbed..889ba7c 100644
--- a/spec/node_spec.rb
+++ b/spec/node_spec.rb
@@ -126,31 +126,25 @@ describe Zorglub do
r.header['location'].should == Node0.r(:do_partial,1,2,3)
end
#
- it "defs should be inherited" do
+ it "inherited_vars should be inherited and extended" do
r = Node5.my_call '/index'
- ar = YAML.load r.body[0]
- ar[0].should == 'js0'
- ar[1].should == 'js1'
- ar[2].should == 'js3'
- ar[3].should == 'jsx'
- ar[4].should be_nil
+ vars = YAML.load r.body[0]
+ vars.should == ['js0','js1','js3','jsx','css0','css1','css2']
+ vars[7].should be_nil
end
#
- it "defs should be method scope modified" do
+ it "inherited_vars should be extended at method level" do
r = Node4.my_call '/more'
- ar = YAML.load r.body[0]
- ar[0].should == 'js0'
- ar[1].should == 'js1'
- ar[2].should == 'js2'
- ar[3].should be_nil
+ vars = YAML.load r.body[0]
+ vars.should == ['js0','js1','js2']
+ vars[3].should be_nil
end
#
- it "defs should not have been modified by other method" do
+ it "inherited_vars should be untouched" do
r = Node4.my_call '/index'
- ar = YAML.load r.body[0]
- ar[0].should == 'js0'
- ar[1].should == 'js1'
- ar[2].should be_nil
+ vars = YAML.load r.body[0]
+ vars.should == ['js0','js1']
+ vars[2].should be_nil
end
end
#