diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-01-08 09:17:10 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-01-08 09:17:10 +0100 |
commit | d59521f3bec769dfe35f1d822617998468f78d7d (patch) | |
tree | ad0bd822bb883c1d48556cb3c9b8059f676b2a8b /spec | |
parent | 8b5ac512744905424c191ea56124a0e7b9f1f787 (diff) | |
download | zorglub-d59521f3bec769dfe35f1d822617998468f78d7d.zip zorglub-d59521f3bec769dfe35f1d822617998468f78d7d.tar.gz |
inherited_vars in cli_vals, fix and comment
Diffstat (limited to 'spec')
-rw-r--r-- | spec/node_spec.rb | 10 | ||||
-rw-r--r-- | spec/spec_helper.rb | 19 |
2 files changed, 17 insertions, 12 deletions
diff --git a/spec/node_spec.rb b/spec/node_spec.rb index 5a0dcf1..a125d56 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -199,25 +199,29 @@ describe Zorglub do Node5.layout.should be_nil end # - it "inherited_vars should be inherited and extended" do + it "cli_vals should be inherited and extended" do r = Node5.my_call '/index' vars = YAML.load r.body[0] vars.should == ['js0','js1','js3','jsx','css0','css1','css2'] vars[7].should be_nil end # - it "inherited_vars should be extended at method level" do + it "cli_vals should be extended at method level" do r = Node4.my_call '/more' vars = YAML.load r.body[0] vars.should == ['js0','js1','js2'] vars[3].should be_nil end # - it "inherited_vars should be untouched" do + it "cli_vals should be untouched" do r = Node4.my_call '/index' vars = YAML.load r.body[0] vars.should == ['js0','js1'] vars[2].should be_nil + r = Node5.my_call '/index' + vars = YAML.load r.body[0] + vars.should == ['js0','js1','js3','jsx','css0','css1','css2'] + vars[7].should be_nil end # it "ext definition and file engine should work" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e710967..9369519 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -122,24 +122,25 @@ end # class Node4 < Zorglub::Node no_layout! - inherited_var :js,'js0' - inherited_var :js,'js1' + cli_val :js,'js0' + cli_val :js,'js1' def index - inherited_var(:js).to_yaml + cli_val(:js).to_yaml end def more - inherited_var(:js,'js2').to_yaml + cli_val :js,'js2' + cli_val(:js).to_yaml end end # class Node5 < Node4 - inherited_var :js, 'js3' - inherited_var :css, 'css0', 'css1' + cli_val :js, 'js3' + cli_val :css, 'css0', 'css1' # no_layout! inherited from Node4 def index - js = inherited_var(:js,'jsx') - inherited_var(:css, 'css0', 'css1','css2') - css = inherited_var :css + js = cli_val(:js,'jsx') + cli_val(:css, 'css0', 'css1','css2') + css = cli_val :css js.concat(css).to_yaml end end |